Qwen-Image-2.1 2-step DMD2 LoRA (V1)

A 2-step distillation LoRA for Qwen-Image-2.1, trained with DMD2 (Distribution Matching Distillation). It turns the base model's 20-step sampling into a 2 forward-pass run while keeping instruction editing and text-to-image quality close to the full-step teacher, which makes it suitable for real-time and interactive pipelines.

  • Base model: Qwen/Qwen-Image-2.1
  • Method: DMD2 (on-policy distribution matching, no regression/GAN loss), teacher CFG guidance
  • LoRA: rank 32, alpha 32, attention-only (to_q, to_k, to_v, to_out.0)
  • Inference: 2 steps, fixed sigmas [1.0, 0.5], true_cfg_scale=1.0
  • Training: multi-aspect (~1 MP) DMD2, 2000 steps on a single H100

Editing: 2 steps vs base 20 steps

The official Qwen-Image-2.1 demo edits (sketch-to-photo, hairstyle, expression, photo restoration), same input, prompt and seed. Middle column is this LoRA at 2 steps; right column is the base model at 20 steps.

2-step vs 20-step editing comparison

Multi-reference composition

Qwen-Image-2.1 takes a list of condition images, referred to as "Picture 1", "Picture 2", ... in the prompt, and the LoRA keeps this working at 2 steps:

image = pipe(
    prompt="Place the cat from Picture 1 on the beach from Picture 2.",
    image=[cat, beach],          # a list of condition images
    num_inference_steps=2,
    sigmas=[1.0, 0.5],
    true_cfg_scale=1.0,
).images[0]

Usage

This model uses the QwenImage21Pipeline, which needs a diffusers build with Qwen-Image-2.1 support (currently the dev branch, not yet on PyPI):

pip install "git+https://github.com/huggingface/diffusers.git@qwenimage21-lora-training"

Image editing

import torch
from diffusers import QwenImage21Pipeline, FlowMatchEulerDiscreteScheduler
from diffusers.utils import load_image

pipe = QwenImage21Pipeline.from_pretrained("Qwen/Qwen-Image-2.1", torch_dtype=torch.bfloat16).to("cuda")

# this LoRA was trained with fixed sigmas (no dynamic shifting)
pipe.scheduler = FlowMatchEulerDiscreteScheduler.from_config(
    pipe.scheduler.config, use_dynamic_shifting=False, shift=1.0, shift_terminal=None
)
pipe.load_lora_weights("linoyts/Qwen-Image-2.1-DMD2-2steps", weight_name="pytorch_lora_weights.safetensors")

image = load_image("input.png")
out = pipe(
    prompt="Turn this into a claymation character of colorful clay.",
    image=image,
    num_inference_steps=2,
    sigmas=[1.0, 0.5],
    true_cfg_scale=1.0,
    generator=torch.Generator("cuda").manual_seed(0),
).images[0]
out.save("edited.png")

Text to image

Drop the image argument and keep everything else the same:

out = pipe(
    prompt="a cute 3d render of a baby dragon made of jelly, soft shadows",
    num_inference_steps=2,
    sigmas=[1.0, 0.5],
    true_cfg_scale=1.0,
    generator=torch.Generator("cuda").manual_seed(0),
).images[0]

Notes

  • The [1.0, 0.5] sigma schedule is the schedule the LoRA was trained on. Because it was trained with fixed sigmas, set use_dynamic_shifting=False and shift=1.0 on the scheduler so the nodes are used exactly as given, rather than being resolution-shifted.
  • No CFG at inference (true_cfg_scale=1.0): the LoRA bakes the teacher's guidance into the student, so a single conditional pass per step is enough.
  • Attention-only adaptation keeps conditioning fidelity high for editing; it preserves the input image more faithfully than adapting the feed-forward blocks as well.

License

Built with Qwen. This is a LoRA adapter for Qwen-Image-2.1 and is a derivative work of it, so it is governed by the Qwen Research License: non-commercial, research and evaluation use only. Commercial use requires a separate license from Qwen.

Qwen is licensed under the Qwen RESEARCH LICENSE AGREEMENT, Copyright (c) 2026 Hangzhou Tongyi Laboratory Technology Co., Ltd. All Rights Reserved.

Downloads last month
1,460
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for linoyts/Qwen-Image-2.1-DMD2-2steps

Adapter
(156)
this model

Spaces using linoyts/Qwen-Image-2.1-DMD2-2steps 2

Collection including linoyts/Qwen-Image-2.1-DMD2-2steps