Comfy-Org / Comfy-Org/ComfyUI

Qwen-image in 24GB VRAM and 32GB RAM

Open
#10,852 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
133k
Forks
15.7k
Avg merge
1d 7h
Merged PRs (30d)
158

Description

My system:
Lenovo Legion Y520T
Motherboard: Legion Y520T-25IKL / 36D9
Processor: Intel(R) Core(TM) i5-7400 CPU @ 3.00GHz
Operational RAM: 32GB
Built-in graphics (not used): Intel Corporation HD Graphics 630
PCI-E graphics with 24VRAM (used with monitors): Gigabyte GeForce RTX 3090 Gaming OC 24GB GDDR6X
Operational system: Ubuntu Linux 20.04
ComfyUI: 0.3.70
ComfyUI_frontend: v1.28.8

I tried to run the qwen-image as described here:
https://comfyui-wiki.com/en/tutorial/advanced/image/qwen/qwen-image

I downloaded these files:
https://huggingface.co/Comfy-Org/Qwen-Image_ComfyUI/resolve/main/split_files/diffusion_models/qwen_image_fp8_e4m3fn.safetensors
https://huggingface.co/Comfy-Org/Qwen-Image_ComfyUI/resolve/main/split_files/text_encoders/qwen_2.5_vl_7b_fp8_scaled.safetensors
https://huggingface.co/Comfy-Org/Qwen-Image_ComfyUI/resolve/main/split_files/vae/qwen_image_vae.safetensors

Then, I build the workflow as shown in screenshot in comfyui-wiki, but without lightx2v LoRA and ModelSamplingAuraFlow. I tried as simple workflow as possible.

If I run the workflow, the server tooks a long file and was automatically killed. I tried three times after system restart.

I suppose, that running the qwen-image in my system is possible under the following circumstances, in one of two scenarios:
1. Scenario 1: Load diffusion into VRAM (about 20GB of 24 GB), VAE and CLIP into RAM (about 10 GB of 32 GB). Convert text into conditioning on CPU, generate image in GPU, convert latent to bitmap on CPU.
2. Scenario 2: Load CLIP into VRAM, encode text, unload CLIP, load diffusion into VRAM, process image, unload diffusion, load VAE into VRAM, convert latent to bitmap, unload VAE.

It is possible to run qwen-image on my system? How to configure the workflow?

I made other experiment: I tried to integrate the qwen-image files into single checkpoint model, using the four nodes:
* Load Diffusion Model
* Load CLIP
* Load VAE
* Save Checkpoint

Trying to run the workflow, the ComfyUI server was killed after several minutes and the checkpoint file was not created. Some time ago, I had GeForce GTX 1050 Tiwith 4GB VRAM instead of GeForce RTX 3090 and used with SDXL 1.0. Every images creation tooks several minutes, but ComfyUI seems to dynamically loads and unloads checkpoint part as necessary, so the run out of memory not happened.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.