-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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?