How to use from the
Use from the
Diffusers library
pip install -U diffusers transformers accelerate
import torch
from diffusers import DiffusionPipeline
from diffusers.utils import load_image

# switch to "mps" for apple devices
pipe = DiffusionPipeline.from_pretrained("SamuelTallet/Qwen-Image-2.1-SDNQ-4bit-dynamic-hadamard256", dtype=torch.bfloat16, device_map="cuda")

prompt = "Turn this cat into a dog"
input_image = load_image("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/cat.png")

image = pipe(image=input_image, prompt=prompt).images[0]

This is Qwen-Image-2.1 optimized using SDNQ with UINT4 dynamic quantization and Hadamard Rotation (Group size: 256).

Sample

Prompt:

This is an RGBA image with transparency. A cute cartoon dragon sticker. The image has alpha channel and the background is transparent.

Seed: 42

Usage

Install Torch, Diffusers (Git), SDNQ 0.2.0+ and Triton.

40 steps.

Downloads last month
230
Safetensors
Model size
4B params
Tensor type
BF16
·
U8
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for SamuelTallet/Qwen-Image-2.1-SDNQ-4bit-dynamic-hadamard256

Quantized
(88)
this model