Qwen-Image-Edit-2511-INT4-Diffusers

This repository contains a Diffusers-compatible NF4 (4-bit NormalFloat) quantized version of the Qwen/Qwen-Image-Edit-2511 model.

Model Overview

  • Base Model: Qwen/Qwen-Image-Edit-2511
  • Quantization: NF4 4-bit with double quantization on the transformer component.
  • Compute dtype: torch.bfloat16 (weights stored in 4-bit, math done in BF16).
  • Pipeline Compatibility: Hugging Face Diffusers (QwenImageEditPlusPipeline).
  • License: Apache 2.0 (Inherited from upstream base model).
  • Weight Format: PyTorch .bin (bitsandbytes NF4 tensors require pickle serialization).

For detailed model architecture, training details, and evaluations, please refer to the official Qwen/Qwen-Image-Edit-2511 repository.

Usage Example

import torch
from diffusers import BitsAndBytesConfig, QwenImageEditPlusPipeline
from diffusers.utils import load_image

# Runtime NF4 quantization (recommended approach for best compatibility)
quant_config = BitsAndBytesConfig(
    load_in_4bit=True,
    bnb_4bit_quant_type="nf4",
    bnb_4bit_compute_dtype=torch.bfloat16,
    bnb_4bit_use_double_quant=True,
)

pipe = QwenImageEditPlusPipeline.from_pretrained(
    "Qwen/Qwen-Image-Edit-2511",
    quantization_config=quant_config,
    torch_dtype=torch.bfloat16,
)
pipe.enable_model_cpu_offload()

input_image = load_image("https://example.com/input.jpg")

output_image = pipe(
    prompt="A realistic tattoo on forearm",
    image=[input_image],
    num_inference_steps=20,
    guidance_scale=4.5,
    height=1024,
    width=768,
).images[0]

output_image.save("output.png")

License

This model is released under the Apache License 2.0, consistent with the original Qwen/Qwen-Image-Edit-2511 release.

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

Model tree for milan33/Qwen-Image-Edit-2511-INT4-Diffusers

Finetuned
(94)
this model