Qwen-Edit-2511 - quantized - int4 - compact

Project Page

Install

quant-qwen-edit quantizes Qwen-Image-Edit and verifies the result empirically. Precision is assigned per layer from activation-aware sensitivity, not uniformly; The int4-compact recipe runs 1024×1024 in 19.5 GB with no offloading, at 0/14 cases outside natural sampler variance. Loads into any diffusers pipeline with one call.

You will need to install it using:

pip install https://huggingface.co/404-Gen/Qwen-Edit-2511-int4-compact/resolve/main/quant_qwen_edit-0.6.1-py3-none-any.whl

Use

import torch
from PIL import Image
from quant_qwen_edit import load_quantized_pipeline

pipe = load_quantized_pipeline(
    "404-Gen/Qwen-Edit-2511-int4-compact",   # HF repo id, or a local directory
    torch_dtype=torch.bfloat16,
    device="cuda",                            # no offloading needed
)

image = Image.open("photo.jpg").convert("RGB").resize((1024, 1024), Image.LANCZOS)

out = pipe(
    prompt="Place a clean printed label on the apple that reads ORGANIC.",
    negative_prompt=" ",
    image=image,
    height=1024,
    width=1024,
    num_inference_steps=40,
    true_cfg_scale=4.0,
    generator=torch.Generator("cuda").manual_seed(7),
).images[0]

out.save("edited.png")

In case custom scheduler is needed to supply or enabling compilation:

    pipe = load_quantized_pipeline(
    "404-Gen/Qwen-Edit-2511-int4-compact",
    scheduler=my_scheduler,     # any component -> forwarded to from_pretrained
    revision="222829069d",      # pin the quantized repo to a commit
    token=hf_token,             # if the repo is private
    offload="model",            # evict the text encoder; ~13.5 GB instead of ~23
    compile=True,               # ~2x faster after a one-off kernel build
)

The pipeline is a stock QwenImageEditPlusPipeline — schedulers, callbacks, LoRA and enable_model_cpu_offload() all work normally.

Faster (optional)

pipe = load_quantized_pipeline(..., compile=True)

24.1 s / 20 steps instead of 40.3 s — faster than bf16. Costs a one-off kernel build on the first call, and recompiles if you change resolution.

Measured

RTX PRO 6000 Blackwell, 1024x1024, no offloading.

peak VRAM 19.54 GB
latency 40.3 s / 20 steps · 80.6 s / 40 steps
on disk 18 GB (transformer 12, text encoder 5.7, VAE 0.24)
transformer 40.85 GB -> 11.91 GB (0.29x)
text encoder 16.58 GB -> 5.7 GB

Quality

Measured against the sampler's own seed-to-seed variance: render bf16 twice at different seeds, see how far two equally-valid samples sit apart, then ask whether quantizing moves the output further than re-rolling the seed does. At or below 1.0 it does not.

mean worst cases over 1.0
int4-compact 0.51x 0.72x 0 of 14
ovedrive NF4 (same harness) 0.58x 1.03x 2 of 14

14 cases spanning text rendering, identity preservation, fine detail, global relighting and structural edits.

Licenses

Base model is Qwen/Qwen-Image-Edit-2511, Apache-2.0

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