Downloads · 30 days
28
3% of all-time downloads
Disty0/Qwen-Image-Layered-SDNQ-uint4-svd-r32
Qwen-Image-Layered-SDNQ-uint4-svd-r32 is a image-to-image model from Disty0. Use it when you need one image transformed into another. It is set up for diffusers. The card lists the license as apache-2.0.
4 bit (UINT4 with SVD rank 32) quantization of Qwen/Qwen-Image-Layered using SDNQ.
Downloads · 30 days
28
3% of all-time downloads
All-time downloads
910
Public
Parameters
10.9B
17.3 GB on disk
Likes
5
Public
Click a slice to open those files.
.safetensors17.3 GB · 100%
How the weights are stored.
U810.2B · 93%
From the Hugging Face model README
4 bit (UINT4 with SVD rank 32) quantization of Qwen/Qwen-Image-Layered using SDNQ.
Usage:
pip install sdnq
import torch
import diffusers
from PIL import Image
from sdnq import SDNQConfig # import sdnq to register it into diffusers and transformers
from sdnq.common import use_torch_compile as triton_is_available
from sdnq.loader import apply_sdnq_options_to_model
pipe = diffusers.QwenImageLayeredPipeline.from_pretrained("Disty0/Qwen-Image-Layered-SDNQ-uint4-svd-r32", torch_dtype=torch.bfloat16)
# Enable INT8 MatMul for AMD, Intel ARC and Nvidia GPUs:
if triton_is_available and (torch.cuda.is_available() or torch.xpu.is_available()):
pipe.transformer = apply_sdnq_options_to_model(pipe.transformer, use_quantized_matmul=True)
pipe.text_encoder = apply_sdnq_options_to_model(pipe.text_encoder, use_quantized_matmul=True)
# pipe.transformer = torch.compile(pipe.transformer) # optional for faster speeds
pipe.enable_model_cpu_offload()
pipe.set_progress_bar_config(disable=None)
image = Image.open("input.png").convert("RGBA")
with torch.inference_mode():
output = pipe(
image=image,
generator=torch.manual_seed(777),
true_cfg_scale=4.0,
negative_prompt=" ",
num_inference_steps=50,
num_images_per_prompt=1,
layers=4,
resolution=640, # Using different bucket (640, 1024) to determine the resolution. For this version, 640 is recommended
cfg_normalize=True, # Whether enable cfg normalization.
use_en_prompt=True, # Automatic caption language if user does not provide caption)
).images[0]
for i, image in enumerate(output):
image.save(f"{i}.png")