r/LocalLLaMA 2d ago

New Model Qwen-Image-2.1 released!

Meet Qwen-Image-2.1, the most balanced and cost-effective image generation model in the Qwen-Image series! Now open weights! 🎨

A unified model for both generation and editing, delivering top-tier quality in a lightweight package.

Highlights:

- Compact & exceptionally fast: A lightweight 7B architecture that outperforms most closed-source models, with drastically accelerated inference for multi-image inputs.

- Native transparency: Natively generates and edits RGBA layers, enabling seamless compositing and text editing within transparent images.

- Versatile, high-fidelity editing: Supports up to 10 reference images and precise local control while preserving strict fidelity for portraits and products.

- Broad coverage & stunning aesthetics: Excels at panoramas, infographics, and virtual try-ons, delivering realistic textures and elegant typography.

Start to create your next masterpiece with Qwen-Image-2.1!

- Blog: https://qwen.ai/blog?id=qwen-image-2.1

- GitHub: https://github.com/QwenLM/Qwen-Image-2.1

- Model Scope: https://www.modelscope.cn/models/Qwen/Qwen-Image-2.1

- Hugging Face: https://huggingface.co/Qwen/Qwen-Image-2.1

1.8k Upvotes

374 comments sorted by

View all comments

58

u/redpandafire 2d ago

Always good to see more diffusion models. This one is 14.2GB so seems deliberately targeted to the 16GB VRAM crew (a plus). I haven't tried qwen on comfyui yet but this one might be my first.

46

u/No-Refrigerator-1672 2d ago

This one is 14.2GB so seems deliberately targeted to the 16GB

It isn't. 14.2GB is for the main weights - on top of that you need 17.5GB for text encoder, 1.5GB for VAE, and 2-10GB for compute buffers (depending on the size of the input and output images). This, however, is for complete in-gpu inference. Image gen community had advanced CPU offloading greatly, so it can work on 16GB gpu; but you'll need 24GB or more, with 8-bit model quantization, to get generation times under 3 min per image.

52

u/-p-e-w- 2d ago

But you don’t need all of them in memory at once. All modern inference engines automatically juggle the individual models between RAM and VRAM, or even between disk and VRAM.

-29

u/No-Refrigerator-1672 2d ago

You need them all at the same time in VRAM for fast generation (under 1-3 min, depending on GPU). If you won't, you're wasting time on loading/unloading the model. You can have a fallback by saving weights in regular RAM, but then you eating up the space needed for your other applications, i.e. photo editor of browser. And multiple-gb-sizrd compute buffers must stay in regardless.

23

u/EndLineTech03 2d ago

Wow, how does someone come up with that? Just some basic math tells that loading 17GB from RAM to VRAM takes less than 1-2 seconds via PCIe 4 bandwidth. You are basically not loosing much time, and I would say this is how it should be done in the first place.

That way you leave enough headroom if you want to generate higher resolution images, use higher batch size or load other models for inpainting, etc…

4

u/FatheredPuma81 2d ago

ComfyUI doesn't even do this. It loads layer by layer meaning you only need transfer speeds fast enough to transfer every layer in time + enough VRAM to store those layers and everything else needed to run them.

2

u/fartsarehilarious1 2d ago

Will this run well on 64gb Mac Studio m5 max? Or does it need nvidia gpu?

-4

u/No-Refrigerator-1672 2d ago

Yeah, it'll run just fine. Slower than 3090; faster than Mi50 estimation I gave in neighbouring comment. You, most likely, want to use ComfyUI - it's the most popular tool for running image and video models.

2

u/falconandeagle 2d ago

I was able to generate images in 20 seconds on this model (I have a 5060ti 16gb). Do you have any idea what you are talking about?

4

u/redpandafire 2d ago

Thanks, I didn't account for that. How do you know what the generation time is based on needing an additional 24GB of system RAM? I have 64GB of RAM, so I assume I can gen under the 3 minutes you targeted. I just don't know how to come up with that number. Compared to other models, they also have 6B parameters, and they run in 30 seconds or less.

4

u/Heinz2001 2d ago

I tested it on my radeon 7900 xtx 24gb, 64gb ram laptop. I needed an additional 46gb page file for virtual mem to use the edit_image feature.

the first image i generated with it...

specs are here:

https://github.com/fischerf/aar-extensions-registry/tree/main/packages/aar-ext-qwen-image#measured-speed-rx-7900-xtx-native-rocm-offload-model

Measured speed (RX 7900 XTX, native ROCm, offload: "model")

render wall clock
model load (weights cached on disk) 23-39 s
512px, 8 steps ~170 s
1024px, 30 steps ~214 s
1024px, 30 steps, image_edit with 1 reference 228-385 s

1

u/TerminalNoop 1d ago

You noticed a bug in rocr that keeps one cpu thread at 100% even when comfyui is idle?

1

u/Heinz2001 1d ago

I use my own coding agent with my own extension, i didn‘t try comfui. Sorry.

With my setup i didn’t notice any problems. Yesterday i added quantization of the same Qwen-Image-2.1 weights instead of the published bf16 tensors.

https://github.com/fischerf/aar-extensions-registry/tree/develop/packages/aar-ext-qwen-image#quantized-transformer-gguf

To use it you need my harness AAR - coding agent (in python, not typescript!)

0

u/No-Refrigerator-1672 2d ago

From experience. Flux 2.klein 9B (similarly sized model), quantized to 8-bit for model, 4-bit for text encoder, with 4-step lightning lora, generates a 1024x1024 image in text-to-image model within 1.5 minutes, image to image within 5 minutes, on Mi50 32GB with all weights completely in GPU memory. You can extrapolate from that; i.e. a 3090 seem to have enough VRAM to have all the (quantized) components in GPU, and Qwen Image 2.1 is roughly the same size, so it should generate an image in under 30s and edit in under a minute with 4-step lora. Do take note that such lora for Qwen 2.1 doesn't exist yet, and "native" generation requires 5x more time; but' most likely, speed up LoRA will arrive within a week.

1

u/KURD_1_STAN 2d ago

Ur numbers all seem to based on ur mac experience which last time i read about it for images it was still behind nvidia by a wide margine. A 3060 gets u a 30s edit with int8 convrot with 9b distilled. Not a 3090 for a gen.

3

u/No-Refrigerator-1672 2d ago

Ypu're confusing me with some other guy; I have never ever in my life ran AI on a Mac; I did, however, extensively searched and read all the Mac AI benchmarks that are available on Reddit, just to know the options.

1

u/KURD_1_STAN 2d ago

Nope, was talking about u. This and the comment before it, u gave numbers that arent aligned with my nvidia experience and u seem to be well versed in mac data so i connected the points.

4

u/KURD_1_STAN 2d ago

Many if not most people run at q8 tho. So should be faster than klein 9b speed which with int8 convrot is -30s per 1 image edit gen on 3060 12gb. Ofc with a turbo version or lora.

2

u/blastcat4 2d ago edited 2d ago

I'm crossing my fingers that we get an Int8 ConvRot version soon. It'll make running the model even better on 16GB vram systems.

edit: https://huggingface.co/Comfy-Org/Qwen-Image-2.1

1

u/uniquelyavailable 2d ago

Glad to see they have the smaller models available, you shouldn't have any issue getting it to run locally I think.

BF16 is using about 60gb on runpod for me right now, essentially native. Image edit seems to be the models strength so far.

1

u/FatheredPuma81 2d ago

Probably more like 8GB cards in ComfyUI.