Update app.py

This commit is contained in:
sigma
2026-01-19 01:27:01 +00:00
committed by system
parent dbfc02751e
commit 7690aa68a5

23
app.py
View File

@@ -239,19 +239,20 @@ from huggingface_hub import hf_hub_download
import torch.nn.functional as F import torch.nn.functional as F
# --- 1. setup pipeline with lightning (this works fine) --- # --- 1. setup pipeline with lightning (this works fine) ---
pipe = QwenImageEditPlusPipeline.from_pretrained( pipe = QwenImageEditPlusPipeline.from_single_file(
"Qwen/Qwen-Image-Edit-2511", "path/to/Qwen-Rapid-AIO-NSFW-v21.safetensors",
original_config="Qwen/Qwen-Image-Edit-2511", # pulls the config from the base repo
scheduler=scheduler, scheduler=scheduler,
torch_dtype=dtype torch_dtype=torch.bfloat16 # use bf16 for speed on zerogpu
).to(device) ).to("cuda")
print("loading lightning lora...") # print("loading lightning lora...")
pipe.load_lora_weights( # pipe.load_lora_weights(
"lightx2v/Qwen-Image-Edit-2511-Lightning", # "lightx2v/Qwen-Image-Edit-2511-Lightning",
weight_name="Qwen-Image-Edit-2511-Lightning-4steps-V1.0-bf16.safetensors" # weight_name="Qwen-Image-Edit-2511-Lightning-4steps-V1.0-bf16.safetensors"
) # )
pipe.fuse_lora() # pipe.fuse_lora()
print("lightning lora fused.") # print("lightning lora fused.")
# # Apply the same optimizations from the first version # # Apply the same optimizations from the first version