Skip to content

Commit 1c0d5a9

Browse files
committed
fix snippet content and move it up to preserve alphabetical order
1 parent 7d38c7a commit 1c0d5a9

File tree

2 files changed

+35
-30
lines changed

2 files changed

+35
-30
lines changed

packages/tasks/src/model-libraries-snippets.ts

Lines changed: 35 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,41 @@ export const diffusers = (model: ModelData): string[] => {
170170
}
171171
};
172172

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+
173208
export const edsnlp = (model: ModelData): string[] => {
174209
const packageName = nameWithoutNamespace(model.id).replaceAll("-", "_");
175210
return [
@@ -905,33 +940,4 @@ whisperkit-cli transcribe --audio-path /path/to/audio.mp3
905940
# Or use your preferred model variant
906941
whisperkit-cli transcribe --model "large-v3" --model-prefix "distil" --audio-path /path/to/audio.mp3 --verbose`,
907942
];
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-
];
937943
//#endregion

packages/tasks/src/model-libraries.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,6 @@ export const MODEL_LIBRARIES_UI_ELEMENTS = {
178178
prettyLabel: "DiffusionKit",
179179
repoName: "DiffusionKit",
180180
repoUrl: "https://github.com/argmaxinc/DiffusionKit",
181-
docsUrl: "https://github.com/argmaxinc/DiffusionKit?tab=readme-ov-file#-image-generation-with-python-mlx",
182181
snippets: snippets.diffusionkit,
183182
},
184183
doctr: {

0 commit comments

Comments
 (0)