Image Generation
Collection
Models, datasets and evaluations results for DiffusionKit: https://github.com/argmaxinc/DiffusionKit • 8 items • Updated • 7
How to use argmaxinc/mlx-FLUX.1-schnell with DiffusionKit:
# Pipeline for Flux from diffusionkit.mlx import FluxPipeline pipeline = FluxPipeline( shift=1.0, model_version=argmaxinc/mlx-FLUX.1-schnell, low_memory_mode=True, a16=True, w16=True, )
# Image Generation HEIGHT = 512 WIDTH = 512 NUM_STEPS = 4 CFG_WEIGHT = 0 image, _ = pipeline.generate_image( "a photo of a cat", cfg_weight=CFG_WEIGHT, num_steps=NUM_STEPS, latent_size=(HEIGHT // 8, WIDTH // 8), )
How to use argmaxinc/mlx-FLUX.1-schnell with MLX:
# Download the model from the Hub pip install huggingface_hub[hf_xet] huggingface-cli download --local-dir mlx-FLUX.1-schnell argmaxinc/mlx-FLUX.1-schnell
# Image Generation
HEIGHT = 512
WIDTH = 512
NUM_STEPS = 4
CFG_WEIGHT = 0
image, _ = pipeline.generate_image(
"a photo of a cat",
cfg_weight=CFG_WEIGHT,
num_steps=NUM_STEPS,
latent_size=(HEIGHT // 8, WIDTH // 8),
)conda create -n diffusionkit python=3.11 -y
conda activate diffusionkit
pip install diffusionkit
diffusionkit-cli --prompt "detailed cinematic dof render of a \
detailed MacBook Pro on a wooden desk in a dim room with items \
around, messy dirty room. On the screen are the letters 'FLUX on \
DiffusionKit' glowing softly. High detail hard surface render" \
--height 768 \
--width 1360 \
--seed 1001 \
--step 4 \
--output ~/Desktop/flux_on_mac.png
Quantized
# Pipeline for Flux from diffusionkit.mlx import FluxPipeline pipeline = FluxPipeline( shift=1.0, model_version=argmaxinc/mlx-FLUX.1-schnell, low_memory_mode=True, a16=True, w16=True, )