Instructions to use kimi000/Flux1-Dev-4Step-V2-2000 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use kimi000/Flux1-Dev-4Step-V2-2000 with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("kimi000/Flux1-Dev-4Step-V2-2000", dtype=torch.bfloat16, device_map="cuda") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Draw Things
- DiffusionBee
FLUX.1-dev Four-Step 路 2000
Standalone Diffusers-format generator EMA from exactly 2000 optimizer updates. Includes merged transformer weights, CLIP and T5 encoders, tokenizers, VAE, custom pipeline/scheduler, demo.py, dependencies, validation report and sample images. No training checkout, PEFT adapter merge or separate base-model download is needed.
This checkpoint uses native single-time conditioning and a global velocity readout with 128 bases. The included transformer integrates those outputs over each denoising interval. All 838 EMA adapter tensors across 419 attention/MLP/output modules are merged into the base model. Conditioning projections remain frozen. The fake model and optimizer states are not needed for inference and are not included.
Install and run
Use Python 3.10+ and a CUDA GPU. Install a CUDA-enabled PyTorch build for your hardware, then:
hf download kimi000/Flux1-Dev-4Step-V2-2000 --local-dir Flux1-Dev-4Step-V2-2000
cd Flux1-Dev-4Step-V2-2000
python -m pip install -r requirements.txt
python demo.py --model . --cpu-offload --prompt 'A vintage pastel illustration of a tropical beach with palm trees and gentle waves.' --output beach.png
python demo.py --model . --cpu-offload --prompt 'A white ceramic mug with the words "GOOD MORNING" printed in large blue letters.' --output mug.png
Alternatively, download just demo.py and requirements.txt; the demo defaults to kimi000/Flux1-Dev-4Step-V2-2000 and automatically downloads the weights. --revision <commit> pins model and custom code. With --cpu-offload, components move to CUDA when needed; without it, components stay on GPU and need substantially more VRAM. Host RAM and GPU needs depend on software and resolution. If downloads stall, retry with HF_HUB_DISABLE_XET=1.
Python API
import torch
from diffusers import DiffusionPipeline
repo = "kimi000/Flux1-Dev-4Step-V2-2000"
pipe = DiffusionPipeline.from_pretrained(
repo, custom_pipeline=repo, trust_remote_code=True,
torch_dtype=torch.bfloat16,
)
pipe.enable_model_cpu_offload()
image = pipe(
prompt='A white ceramic mug with the words "GOOD MORNING" printed in blue.',
num_inference_steps=4, guidance_scale=3.5,
height=1024, width=1024,
generator=torch.Generator(device="cpu").manual_seed(0),
).images[0]
image.save("result.png")
Required settings
- Use four steps and
guidance_scale=3.5. The guidance value is the native FLUX.1-dev distilled guidance embedding. No additional two-pass classifier-free guidance or negative prompt is used. - Use the included custom pipeline, transformer and scheduler together. Standard
FluxPipelinecannot interpret the expanded output projection. The backbone receives the current time only; the interval endpoint controls the integrated readout. The raw schedule is1-j/3.5forj=0..3, followed by zero, with rational shiftexp(1.15)and final-step scale0.5. - Loading requires
custom_pipeline=repo, trust_remote_code=True. Review the included Python files before enabling remote code. - Transformer and text encoders use BF16; VAE decoding remains FP32. The custom VAE loader preserves this. Do not cast the entire pipeline to BF16.
- Use a CPU
torch.Generatorto match the training noise path. Initial noise is BF16 rounded, integration is FP32. Results can vary across hardware and library versions. - Training resolution is 1024脳1024. Dimensions must be multiples of 16 and at least 64. CLIP and T5 prompts are truncated to 77 and 512 tokens respectively. No prompt upsampler is used.
- The English training prompt mixture is 50% MJHQ, 25% sampled TextAtlas and 25% text-rendering reward prompts. Training uses prompts without target images, global batch size 128, and AdamW betas
(0, 0.999). - This is an experimental four-step checkpoint. Numerical parity and valid image files do not establish visual quality or OCR accuracy; text can contain errors.
- EMA deltas are merged in FP32 and rounded into BF16 weights. The included validation compares the exported sampler with the training model loaded with those exact merged weights.
Examples and validation
See validation_report.json for actual GPU parity, component precision, four transformer calls and sampling results. export_metadata.json identifies the source step, checkpoint checksum and merged tensor hashes. file_manifest.json provides checksums for the uploaded artifacts.
License
The original FLUX.1 [dev] Non-Commercial License applies. See LICENSE.md, NOTICE.md and BASE_MODEL_CARD.md. This derivative is published by kimi000 and is not an official Black Forest Labs release. Base revision: 3de623fc3c33e44ffbe2bad470d0f45bccf2eb21.
Checkpoint version
This is the revised 2000-step checkpoint, distinct from the earlier Flux1-Dev-4Step-2000 release. Training samples renoise times conditionally between the sampled query endpoint q and current time t, then re-noises the detached clean prediction from time zero. Its final-step scale is 0.5; use the bundled scheduler.
- Downloads last month
- -
Model tree for kimi000/Flux1-Dev-4Step-V2-2000
Base model
black-forest-labs/FLUX.1-dev
