Instructions to use linoyts/acedit-qwen-image-2.1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use linoyts/acedit-qwen-image-2.1 with PEFT:
Task type is invalid.
- Notebooks
- Google Colab
- Kaggle
ACEdit on Qwen-Image-2.1 — student LoRA
Reproduction of ACEdit: Stable Multi-Turn Image Editing via Asymmetric Conditioning (arXiv 2610.22328) applied to the Qwen-Image-2.1 family.
- Student = Qwen/Qwen-Image-2.1-Turbo (8-step, CFG=1) + this rank-16 LoRA
- Teacher = Qwen/Qwen-Image-2.1, frozen, CFG 2, asymmetric conditioning (source image + compound instruction)
- Aux editor = base 2.1 + its own rank-16 LoRA (
aux_lora.safetensors), trained jointly (DMD fake-score model)
Recipe (paper §4–§5.1)
10-turn latent rollouts without VAE decode; exit step sU{1..8}; DMD gradient
w(τ)(v̂φ^γ − v̂ψ) evaluated at z_τ(x̂ˢ) with τU[0,1); asymmetric conditioning on (I₀, h_e);
5 warmup iters (aux only) + aux every iter / student every 5th; AdamW(0, 0.999), wd 0.01,
clip 10, bf16; lr 4e-5 (student) / 8e-6 (aux). Training data: 96 synthetic 1024² scenes with
10-edit chains (dataset acedit-qwen-image-2.1-chains),
generated with the student itself.
⚠️ Result: the paper's stability gain did NOT reproduce at this scale
This run is a half run: 250 training iters = 50 student updates (paper: 500 iters / 100 updates, ~4.4 B200-hours). Losses were healthy (aux FM 3.7→0.16; student DMD loss low and stable), the LoRA verifiably attaches and affects outputs — but the multi-turn stability effect was not measured:
| Eval (16 held-out chains ×10 turns, fixed seed, full-image proxies) | base Turbo | trained | note |
|---|---|---|---|
| Edit chains: LPIPS vs source @10 | 0.727 | 0.720 | saturated by legitimate edits |
| Edit chains: DINO cos vs source @10 | 0.622 | 0.615 | same |
| No-op chains (10× "keep as is"): LPIPS @10 | 0.706 | 0.697 | ~1% — within per-chain noise |
| No-op chains: DINO cos @10 | 0.762 | 0.762 | identical to 4 decimals |
The no-op test is the paper-sensitive proxy (its Fig. 3), and it shows no measurable
stability gain. Full artifacts: EVALUATION.md, noop_summary.json, noop_per_chain.json,
per-turn PNGs in this repo.
Stated deviations beyond the half run (each a candidate explanation, untested here): edit chains from a template bank, not LLM-written; compound instructions h_e built by fluent-join templates, not LLM rewrites; w(τ)=1/max(τ,0.05) chosen for the paper's unspecified normalization; student is the 8-step Turbo checkpoint rather than 4-step FLUX.2-klein-9B; evaluation uses full-image proxies instead of background-masked LPIPS / anchor DINOv2 (GroundingDINO) and no VLM judge.
Usage
Manual peft attach (verified path):
from peft import LoraConfig
from safetensors.torch import load_file
transformer.add_adapter(LoraConfig(r=16, lora_alpha=16, target_modules=["to_k","to_q","to_v","to_out.0"]))
sd = load_file("student_lora.safetensors") # raw peft keys; strip a "transformer." prefix if present
mapped = {k.removeprefix("transformer.").replace(".lora_A.", ".lora_A.default.").replace(".lora_B.", ".lora_B.default."): v for k, v in sd.items()}
transformer.load_state_dict(mapped, strict=False)
pipe.load_lora_weights on this file is not guaranteed (verified inconsistent) — the key
metadata format that diffusers' loader expects was not fully reproduced.
- Downloads last month
- -