modelscope / modelscope/DiffSynth-Studio

vram_limit is not taking effect

Open
#1,247 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
13.1k
Forks
1.3k
Avg merge
13h 12m
Merged PRs (30d)
45

Description

define vram config

vram_config_light = {
"offload_dtype": torch.bfloat16,
"offload_device": "cpu",
"onload_dtype": torch.bfloat16,
"onload_device": "cpu",
"preparing_dtype": torch.bfloat16,
"preparing_device": device,
"computation_dtype": torch.bfloat16,
"computation_device": device,
}
vram_config = vram_config_light
vram_limit = 22.0

initialize Qwen Image Pipeline

pipe = QwenImagePipeline_2511.from_pretrained(
scheduler_template="Qwen-Image-LightX2v",
torch_dtype=torch.bfloat16,
device=device,
model_configs=[
ModelConfig_2511(
model_id="Qwen-Image-Edit-2511",
origin_file_pattern="transformer/diffusion_pytorch_model*.safetensors",
local_model_path=local_model_path,
skip_download=True,
*vram_config
),
ModelConfig_2511(
model_id="Qwen-Image-Edit-2511",
origin_file_pattern="text_encoder/model
.safetensors",
local_model_path=local_model_path,
skip_download=True,
**vram_config
),
ModelConfig_2511(
model_id="Qwen-Image-Edit-2511",
origin_file_pattern="vae/diffusion_pytorch_model.safetensors",
local_model_path=local_model_path,
skip_download=True,
**vram_config
),
],
tokenizer_config=ModelConfig_2511(
model_id="Qwen-Image-Edit-2511",
origin_file_pattern="tokenizer/",
local_model_path=local_model_path,
skip_download=True
),
processor_config=ModelConfig_2511(
model_id="Qwen-Image-Edit-2511",
origin_file_pattern="processor/",
local_model_path=local_model_path,
skip_download=True
),
vram_limit=vram_limit,
)

when I set vram_limit 22.0 and run qwen-image-edit-2511 on 4090 24G, it's out of memory.
it seems vram_limit is not taking effect.
anybody know how to run qwen-image-edit-2511 on 4090 24G?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the provided Qwen Image Edit 2511 pipeline configuration with vram_limit=22.0 on an RTX 4090 and capture the out-of-memory details. Trace how vram_limit is applied during pipeline initialization and model loading; done means the configuration runs within the stated VRAM limit or clearly reports why it cannot.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, pytorch
Domain
machine-learning, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.