Views
No views yet
Follow @treadon on X and treadon on Hugging Face for more AI experiments, evals, and projects.
![]() An ethereal fairy with translucent wings sitting on a crescent moon surrounded by skulls (1024×576, 50 steps, CFG 3.5, bf16) | ||
![]() A red apple on a white table | ![]() A golden retriever puppy in autumn leaves | ![]() A futuristic city skyline at sunset |
![]() A cup of coffee on a rainy windowsill | ![]() An astronaut riding a horse on the moon |
1git clone https://huggingface.co/treadon/mlx-nucleus-image
2cd mlx-nucleus-image
3pip install mlx torch transformers huggingface_hub pillow
4
5python generate.py --prompt "A red apple on a white table" --seed 42| Flag | Default | Description |
|---|---|---|
--prompt | required | Text prompt |
--height | 512 | Image height |
--width | 512 | Image width |
--steps | 50 | Denoising steps (30 is usually fine) |
--cfg | 4.0 | Guidance scale |
--seed | random | Random seed |
--output | output.png | Output path |
--quantize | 4 | Quantization bits (4, 8, or None) |
| Resolution | Steps | Time |
|---|---|---|
| 256x256 | 20 | ~54s |
| 512x512 | 20 | ~70s |
| 512x512 | 30 | ~100s |
| Original (PyTorch) | MLX | Why |
|---|---|---|
| CausalConv3d | Conv2d, last temporal slice | Causal padding (2p, 0) means only kernel[:,:,-1,:,:] fires for T=1 |
| SwiGLU (dense FFN) | value * silu(gate) | First half = value, second = gate |
| SwiGLU (MoE experts) | silu(gate) * up | First half = gate, second = up (different convention!) |
| RoPE (complex polar) | cos/sin decomposition | scale_rope=True: centered positions [-H/2..H/2] |
| AdaLayerNormContinuous | LayerNorm + scale/shift | Scale first, shift second, affine=False |
| Expert-choice MoE | argsort + indicator matrix | Each expert picks top-C tokens, scatter via matmul |