@@ -170,6 +170,41 @@ export const diffusers = (model: ModelData): string[] => {
170
170
}
171
171
} ;
172
172
173
+ export const diffusionkit = ( ) : string [ ] => {
174
+ const sd3Snippet = `from diffusionkit.mlx import DiffusionPipeline
175
+
176
+ pipeline = DiffusionPipeline(
177
+ shift=3.0,
178
+ use_t5=False,
179
+ model_version="argmaxinc/mlx-stable-diffusion-3-medium",
180
+ low_memory_mode=True,
181
+ a16=True,
182
+ w16=True,
183
+ )` ;
184
+ const fluxSnippet = `from diffusionkit.mlx import FluxPipeline
185
+
186
+ pipeline = FluxPipeline(
187
+ shift=1.0,
188
+ model_version="argmaxinc/mlx-FLUX.1-schnell",
189
+ low_memory_mode=True,
190
+ a16=True,
191
+ w16=True,
192
+ )` ;
193
+ const generateSnippet = `HEIGHT = 512
194
+ WIDTH = 512
195
+ NUM_STEPS = 4 # 4 for FLUX.1-schnell, 50 for SD3
196
+ CFG_WEIGHT = 0. # for FLUX.1-schnell, 5. for SD3
197
+
198
+ image, _ = pipeline.generate_image(
199
+ "a photo of a cat",
200
+ cfg_weight=CFG_WEIGHT,
201
+ num_steps=NUM_STEPS,
202
+ latent_size=(HEIGHT // 8, WIDTH // 8),
203
+ )` ;
204
+
205
+ return [ sd3Snippet , fluxSnippet , generateSnippet ] ;
206
+ } ;
207
+
173
208
export const edsnlp = ( model : ModelData ) : string [ ] => {
174
209
const packageName = nameWithoutNamespace ( model . id ) . replaceAll ( "-" , "_" ) ;
175
210
return [
@@ -905,33 +940,4 @@ whisperkit-cli transcribe --audio-path /path/to/audio.mp3
905
940
# Or use your preferred model variant
906
941
whisperkit-cli transcribe --model "large-v3" --model-prefix "distil" --audio-path /path/to/audio.mp3 --verbose` ,
907
942
] ;
908
-
909
- export const diffusionkit = ( ) : string [ ] => [
910
- `# Install CLI with pip
911
- pip install diffusionkit-cli
912
-
913
- # View all available options
914
- diffusionkit-cli --help
915
-
916
- # Generate image using default FLUX.1-schnell and save it to out.png
917
- diffusionkit-cli --prompt "a beautiful sunset over the ocean"
918
-
919
- # To use Stable Diffusion 3 accept the terms before downloading the checkpoint: https://huggingface.co/stabilityai/stable-diffusion-3-medium
920
- # Once you accept the terms, sign in with your Hugging Face hub token with read access to contents of all public gated repos you can access:
921
- huggingface-cli login --token YOUR_HF_HUB_TOKEN
922
-
923
- # Use specific model and set custom output path
924
- diffusionkit-cli --prompt "a futuristic cityscape" --model-version stable-diffusion-3-medium --output-path /path/to/output.png
925
-
926
- # Set seed for reproducibility, specify number of steps, and set custom output image dimensions
927
- diffusionkit-cli --prompt "detailed cinematic dof render of a \
928
- detailed MacBook Pro on a wooden desk in a dim room with items \
929
- around, messy dirty room. On the screen are the letters 'FLUX on \
930
- DiffusionKit' glowing softly. High detail hard surface render" \
931
- --height 768 \
932
- --width 1360 \
933
- --seed 1001 \
934
- --step 4 \
935
- --output ~/Desktop/flux_on_mac.png` ,
936
- ] ;
937
943
//#endregion
0 commit comments