How to use from the
Use from the
Diffusers library
pip install -U diffusers transformers accelerate
import torch
from diffusers import DiffusionPipeline

# switch to "mps" for apple devices
pipe = DiffusionPipeline.from_pretrained("data-archetype/dflow_2b", dtype=torch.bfloat16, device_map="cuda")
pipe.load_lora_weights("lvladikov/DFlow2-Distill-4steps-eDMD-LADD-LoRA")

prompt = "Busy outdoor street market crowded with many people browsing colorful fruit and vegetable stalls, awnings, midday sun, wide shot, photorealistic"
image = pipe(prompt).images[0]

DFlow2 4-step LoRA (eDMD + LADD)

A LoRA for dflow_2b by Data Archetype that makes a picture in 4 steps of one model pass each, instead of the release's default 50 steps with path-drop guidance (two passes a step): 4 model passes instead of 100.

Status. dflow_2b is an early preview that is still being trained, and this LoRA is made for its current version: chk00011000 (11,000 training samples, 22 Nov 2026). If dflow_2b is updated, this LoRA may be updated to follow it. Text in images is its weakest part: letters are often doubled or wrong, the more so in longer text and at the two larger sizes (dflow_2b's own text is approximate too).

Examples

Prompt
Busy outdoor street market crowded with many people browsing colorful fruit and vegetable stalls, awnings, midday sun, wide shot, photorealistic
Prompt
Overhead shot of a rustic wood-fired pizza with bubbling melted cheese, basil leaves, charred crust, on a dark wooden table, food photography
Prompt
Portrait of a young woman with freckles and windswept auburn hair, soft window light, shallow depth of field, photograph, sharp detail
Prompt
A snow leopard walking along a rocky ridge in falling snow, telephoto wildlife photograph, natural light

This LoRA at 4 steps, 1824Γ—1024, seed 4242 (chk00011000); each picture's prompt is in its caption. Click a picture to open it. Side by side with dflow_2b at 50 steps and at 4 steps: Comparisons.

Comparisons

Each row: the same prompt, seed and starting noise. Left, dflow_2b at its default 50 steps (what the LoRA learns from); middle, dflow_2b cut to 4 steps; right, dflow_2b with this LoRA at 4 steps.

A portrait A snow leopard A street market A wood-fired pizza

ComfyUI

dflow_2b runs in ComfyUI through its own nodes, shipped in its repository. They have no LoRA support (at the time of writing), and ComfyUI's own LoRA loaders can't attach to their model. LVNodes' DFlow node set (LVNodes/ComfyUI-DFlow-LoRA/ here, also part of ComfyUI Nodes and Workflows) adds two small nodes (no extra Python packages):

  • DFlow LoRA (unmerged) applies this LoRA to the DFlow Loader's model, beside the weights rather than merged into them (a merge into bfloat16 would round a step LoRA's small changes away). Strength 1.0 as trained.
  • DFlow Size and Gain (from latent) reads the image size from DFlow Empty Latent and gives the guider the self-attention gain this LoRA was trained with at that size, and DFlow Layout Encode its width and height, so the size is set in one place.

Needs an NVIDIA GPU: dflow_2b's own nodes run on CUDA only (at the time of writing): their loader refuses other devices, Apple's MPS included. On an Apple Silicon Mac, use the MLX workflows below.

Install

  1. dflow_2b, as its README says (the repository is a custom-node folder):
    cd ComfyUI/custom_nodes
    hf download data-archetype/dflow_2b --local-dir dflow_2b
    
    Its loader needs timm, which dflow's autoencoder imports and a default ComfyUI doesn't include: pip install timm. On a default ComfyUI v0.46.2 with dflow_2b v0.215, that one package was all it needed in our test. (dflow's full requirements.txt works too, but on a current ComfyUI it also downgrades huggingface_hub below 2.0.)
  2. The two nodes, as an LVNodes node set:
    • No LVNodes yet: copy the folder LVNodes/ from here into ComfyUI/custom_nodes/.
    • Already using LVNodes (any of its other node sets): add, don't replace. Copy only LVNodes/ComfyUI-DFlow-LoRA/ into your existing custom_nodes/LVNodes/. Don't replace or delete your LVNodes folder: it holds your other node sets and, on a Mac, two hidden folders LVNodes created there (.venv, .cache). In macOS Finder, don't drag LVNodes onto custom_nodes: Finder would replace the whole folder, hidden folders included.
  3. Put dflow2_4steps_edmd_ladd_rank_64_lora_comfyui.safetensors into ComfyUI/models/loras/.
  4. Restart ComfyUI and open a workflow from here:
    • dflow2_4steps_lora_t2i_local.json: text to image;
    • dflow2_4steps_lora_layout_t2i_local.json: dflow's JSON layout prompts.

Use

Write the prompt and set any size in DFlow Empty Latent; nothing else depends on it. Keep the workflow's settings: 4 steps, euler, the beta_1_25 schedule with the resolution shift on, PDG and CFG off, DFlow Loader's compile_model off (a compiled model wouldn't take the LoRA). Trained at 832Γ—1216, 1216Γ—832, 1824Γ—1024 and 1024Γ—1824, on short prompts, captions, long detailed prompts, dflow's JSON layouts and prompts that ask for text.

dflow_2b doesn't run on Comfy Cloud, which doesn't have its nodes.

Apple Silicon Mac (MLX)

LVNodes' ComfyUI-DFlow-MLX runs dflow_2b and this LoRA on Apple's MLX: DFlow Model (MLX) (the dflow_2b folder, the LoRA, float16 compute) and DFlow Sampler (MLX) (prompt or JSON layout, size, steps, seed). The same release, schedule, solver and prompt rules; a seed draws the release's own noise.

The MLX text-to-image workflow in ComfyUI on an Apple Silicon Mac The MLX text-to-image workflow on an Apple Silicon Mac: DFlow Model (MLX) with this LoRA at 1.0 and float16 compute, DFlow Sampler (MLX) at 1024Γ—1824, 4 steps, guidance 1, euler, the self-attention gain set by the size (-1), and the picture.

  1. dflow_2b downloaded into ComfyUI/custom_nodes/dflow_2b with the hf download command of Install above (timm isn't needed here; its own nodes won't run on a Mac, but the MLX nodes read its weights, text encoder and prompt rules from there). Its autoencoder, dinac3_96, downloads on the first run (about 320 MB).
  2. LVNodes/ from here into ComfyUI/custom_nodes/, or, already using LVNodes, only LVNodes/ComfyUI-DFlow-MLX/ into your custom_nodes/LVNodes/ (add, don't replace). The first run sets up LVNodes' own MLX environment (LVNodes/.venv, about 1.3 GB, once); ComfyUI's own Python packages aren't changed.
  3. dflow2_4steps_edmd_ladd_rank_64_lora_comfyui.safetensors into ComfyUI/models/loras/.
  4. Restart ComfyUI and open dflow2_4steps_lora_t2i_MLX_LVNodes.json (text to image) or dflow2_4steps_lora_layout_t2i_MLX_LVNodes.json (JSON layout). Set the size in DFlow Sampler (MLX); keep 4 steps, guidance 1, euler.

Files

File For
dflow2_4steps_edmd_ladd_rank_64_lora_comfyui.safetensors ComfyUI, with the nodes above
dflow2_4steps_edmd_ladd_rank_64_lora.safetensors Python: the same weights, keyed by the release's own denoiser names (<key>.lora_down.weight, .lora_up.weight, .alpha)
dflow2_4steps_edmd_ladd_rank_64_lora_checkpoint_info.md which checkpoint these are, with checksums
LVNodes/ the ComfyUI nodes as LVNodes node sets: ComfyUI-DFlow-LoRA/ (NVIDIA) and ComfyUI-DFlow-MLX/ (Apple Silicon)
dflow2_4steps_lora_t2i_local.json, dflow2_4steps_lora_layout_t2i_local.json the workflows (NVIDIA)
dflow2_4steps_lora_t2i_MLX_LVNodes.json, dflow2_4steps_lora_layout_t2i_MLX_LVNodes.json the workflows (Apple Silicon, MLX)

How it was trained

For dflow_2b v0.215, the current version: trained on v0.21, whose weights v0.215 keeps unchanged (the same model.safetensors). Distilled from dflow_2b at its default settings (50 steps, path-drop guidance 2.5) into 4 Euler steps on the model's own schedule. Three signals train it: eDMD, which matches the 4-step results to the guided 50-step teacher's distribution; LADD, a critic on the teacher's own features that judges texture against the teacher's pictures; and teacher pairs: for a share of the batches the 4-step picture starts from the same noise as a stored 50-step teacher picture and is held to it at coarse scale, which keeps exposure and layout on the teacher's. Rank 64, on the attention and MLP layers of all 30 image blocks.

License

The same terms as dflow_2b: the ModelGo Attribution-NonCommercial License 2.0 (MG-BY-NC 2.0, non-commercial; LICENSE). LVNodes/ComfyUI-DFlow-LoRA/ and LVNodes/ComfyUI-DFlow-MLX/ (a port of dflow_2b's inference code to MLX) are GPL-3.0 (each its own LICENSE), as ComfyUI and dflow_2b's own code are; LVNodes' loader (LVNodes/__init__.py) is Apache-2.0, as in ComfyUI Nodes and Workflows.

This project uses dflow_2b by Data Archetype. https://huggingface.co/data-archetype/dflow_2b

Downloads last month
68
Inference Examples
Examples
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for lvladikov/DFlow2-Distill-4steps-eDMD-LADD-LoRA

Adapter
(1)
this model

Space using lvladikov/DFlow2-Distill-4steps-eDMD-LADD-LoRA 1