Instructions to use zjwfufu/SMD-FLUX.1-dev with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use zjwfufu/SMD-FLUX.1-dev with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("black-forest-labs/FLUX.1-dev", dtype=torch.bfloat16, device_map="cuda") pipe.load_lora_weights("zjwfufu/SMD-FLUX.1-dev") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Draw Things
- DiffusionBee
import torch
from diffusers import DiffusionPipeline
# switch to "mps" for apple devices
pipe = DiffusionPipeline.from_pretrained("black-forest-labs/FLUX.1-dev", dtype=torch.bfloat16, device_map="cuda")
pipe.load_lora_weights("zjwfufu/SMD-FLUX.1-dev")
prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k"
image = pipe(prompt).images[0]SMD-FLUX.1-dev
4-step SMD for text-to-image generation. The student adapters, standalone inference code and reproducible examples are included. Upstream base components are downloaded separately.
Training code · SMD collection
Example
Prompt: A slightly worn cream canvas tote bag printed "SMD" in dark green, hanging on a wooden hook in a cozy home entryway. A casual jacket hangs beside it, a houseplant peeks into the corner. Warm afternoon light, candid everyday photograph.
Seed: 123. Size: 1360 × 768.
Case settings · Generation receipt
Models
| Variant | Weights | Steps | Size |
|---|---|---|---|
| default | LoRA | 4 | 1.30 GB |
Run
Base: black-forest-labs/FLUX.1-dev.
Use Linux, Python 3.12 and an NVIDIA GPU with CUDA support. The included inference code does not import the SMD training repository.
python3.12 -m venv .venv
source .venv/bin/activate
python -m pip install huggingface-hub
# Authenticate to access the gated FLUX.1-dev base model.
hf auth login
hf download zjwfufu/SMD-FLUX.1-dev --local-dir SMD-FLUX.1-dev --exclude 'lora/lora.safetensors'
cd SMD-FLUX.1-dev
python -m pip install -r requirements.txt
python infer.py --output outputs
The first inference downloads approximately 32 GiB of upstream base components into the Hugging Face cache, in addition to the 1.30 GB adapter. Later runs reuse that cache. Obtain access to the gated FLUX.1-dev base model using the account you authenticate with.
The example was run on an A100 80 GB. Model CPU offload reduces GPU memory usage; enough host RAM is still needed to load the upstream components. Use --prompt, --seed and --output to generate another case. --base accepts a local upstream snapshot.
Weight layout
Student weights are also published at the repository root (smd_lora.safetensors). The legacy weight paths remain available for existing integrations. The download command above excludes the duplicate legacy weights; the supplied loader prefers root weights and falls back to legacy paths. Adapter configurations, merge precision and sampling schedules are preserved.
Sampling
The released sampler uses raw final-segment scale 0.5. The raw grid is built before the model-specific time shift. The included runner follows sampling.json; changing only an upstream pipeline's step count does not reproduce the student.
External classifier-free guidance is disabled for the students. Any embedded guidance remains specified in sampling.json.
The supplied loader validates and applies all LoRA matrices and saved replacement tensors, with the recorded merge precision. Omitting replacement tensors or using a different base can change the result.
License and attribution
Base components retain the terms described in the black-forest-labs/FLUX.1-dev model card. Original code notices and bundled licenses are retained. Adapter use remains subject to the applicable base-model terms.
- Downloads last month
- -
Model tree for zjwfufu/SMD-FLUX.1-dev
Base model
black-forest-labs/FLUX.1-dev