topabaem's picture
Make model card concise and image-focused; move full details to linked pages
a99bedb verified
|
Raw History Blame Contribute Delete
3.3 kB
metadata
license: other
license_name: qwen-research
license_link: LICENSE
base_model: Qwen/Qwen-Image-2.1
pipeline_tag: image-to-image
language:
  - en
datasets:
  - osunlp/MagicBrush
tags:
  - image-editing
  - lora
  - diffusion
  - research
  - 8-step
  - custom-adapter

Qwen-Image-2.1-UltraFast

Qwen-Image-2.1-UltraFast

8-step image editing based on Qwen-Image-2.1. Built with Qwen · Non-commercial research.

Detailed documentation & benchmarks · Setup & usage · GGUF download

Image comparisons

Input → original model (40 steps) → UltraFast (8 steps). These are two recorded BF16 training examples. Each detail view is a crop of the same example.

Expression edit

“What if she had a sad face?”

Expression edit: full comparison

Expression edit: same-example detail

Add a flower sticker

“Let's add a flower sticker on the fridge.”

Flower sticker: full comparison

Flower sticker: same-example detail

Original image files · Image credits

At a glance

Original UltraFast
Denoising steps 40 8
Recorded mean denoising time 69.23 s 17.89 s

Historical comparison on two training cases, with loading, encoding and VAE decoding excluded; T40 includes recording callbacks. Quality retention is unmeasured. Full Flint charts and limitations.

Code: load the adapter

Use the included custom loader in a CUDA/BF16 environment. Installation instructions.

from pathlib import Path
import sys
import torch
from huggingface_hub import snapshot_download
from diffusers import QwenImage21Transformer2DModel

local = Path(snapshot_download(
    "Haverbex/Qwen-Image-2.1-UltraFast",
    allow_patterns=["adapter/*", "ultraedit_adapter.py", "configs/*", "LICENSE", "NOTICE"],
))
sys.path.insert(0, str(local))
from ultraedit_adapter import inject_dit_lora, load_adapter

transformer = QwenImage21Transformer2DModel.from_pretrained(
    "Qwen/Qwen-Image-2.1",
    subfolder="transformer",
    revision="790c92633540aa0cb11d9abf19eb46d861714758",
    torch_dtype=torch.bfloat16,
    device_map={"": "cuda:0"},
)
adapters = inject_dit_lora(
    transformer, rank=32, alpha=32, adapter_dtype=torch.bfloat16,
)
load_adapter(adapters, local / "adapter")
transformer.eval()

Download the loading script. This loads weights only. The full generation components and recorded eight-step schedule are explained in the usage guide.

Formats: BF16 adapter · Merged Q4_K GGUF, 3.77 GiB. GGUF image quality and speed have not been benchmarked.

License · Notice · Training and verification details