multimodalart HF Staff commited on
Commit
efd7824
·
verified ·
1 Parent(s): 3fb5c63

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -4
app.py CHANGED
@@ -28,8 +28,8 @@ dtype = torch.bfloat16
28
  device = "cuda" if torch.cuda.is_available() else "cpu"
29
 
30
  pipe = QwenImageEditPlusPipeline.from_pretrained("Qwen/Qwen-Image-Edit-2509",
31
- transformer= QwenImageTransformer2DModel.from_pretrained("linoyts/Qwen-Image-Edit-Rapid-AIO",
32
- subfolder='transformer',
33
  torch_dtype=dtype,
34
  device_map='cuda'),torch_dtype=dtype).to(device)
35
 
@@ -39,8 +39,10 @@ pipe.load_lora_weights(
39
  weight_name="Qwen-Edit-Relight.safetensors", adapter_name="relight"
40
  )
41
 
42
- pipe.set_adapters(["relight"], adapter_weights=[1.])
43
- pipe.fuse_lora(adapter_names=["relight"], lora_scale=1)
 
 
44
  pipe.unload_lora_weights()
45
 
46
  pipe.transformer.__class__ = QwenImageTransformer2DModel
 
28
  device = "cuda" if torch.cuda.is_available() else "cpu"
29
 
30
  pipe = QwenImageEditPlusPipeline.from_pretrained("Qwen/Qwen-Image-Edit-2509",
31
+ #transformer= QwenImageTransformer2DModel.from_pretrained("linoyts/Qwen-Image-Edit-Rapid-AIO",
32
+ # subfolder='transformer',
33
  torch_dtype=dtype,
34
  device_map='cuda'),torch_dtype=dtype).to(device)
35
 
 
39
  weight_name="Qwen-Edit-Relight.safetensors", adapter_name="relight"
40
  )
41
 
42
+ pipe.load_lora_weights("lightx2v/Qwen-Image-Lightning",
43
+ weight_name="Qwen-Image-Lightning-4steps-V2.0.safetensors", adapter_name="lightning")
44
+ pipe.set_adapters(["relight", "lightning"], adapter_weights=[1., 1.])
45
+ pipe.fuse_lora(adapter_names=["relight", "lightning"], lora_scale=1)
46
  pipe.unload_lora_weights()
47
 
48
  pipe.transformer.__class__ = QwenImageTransformer2DModel