Terrantula commited on
Commit
2f491ae
·
verified ·
1 Parent(s): 14bcd18

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -4
app.py CHANGED
@@ -23,13 +23,23 @@ import os
23
  dtype = torch.bfloat16
24
  device = "cuda" if torch.cuda.is_available() else "cpu"
25
 
 
 
 
 
 
 
 
 
 
 
26
  pipe = QwenImageEditPlusPipeline.from_pretrained("Qwen/Qwen-Image-Edit-2509",
27
- transformer= QwenImageTransformer2DModel.from_pretrained("linoyts/Qwen-Image-Edit-Rapid-AIO",
28
  subfolder='transformer',
29
  torch_dtype=dtype,
30
- device_map='cuda'),torch_dtype=dtype).to(device)
31
-
32
-
33
 
34
  pipe.load_lora_weights("rsshekhawat/Qwen-Edit-3DChibi-LoRA",
35
  weight_name="qwen_3d_chibi_lora_v1_000000820.safetensors",
 
23
  dtype = torch.bfloat16
24
  device = "cuda" if torch.cuda.is_available() else "cpu"
25
 
26
+ # pipe = QwenImageEditPlusPipeline.from_pretrained("Qwen/Qwen-Image-Edit-2509",
27
+ # transformer= QwenImageTransformer2DModel.from_pretrained("linoyts/Qwen-Image-Edit-Rapid-AIO",
28
+ # subfolder='transformer',
29
+ # torch_dtype=dtype,
30
+ # device_map='cuda'),torch_dtype=dtype).to(device)
31
+
32
+ from transformers import BitsAndBytesConfig
33
+
34
+ bnb_config = BitsAndBytesConfig(load_in_8bit=True)
35
+
36
  pipe = QwenImageEditPlusPipeline.from_pretrained("Qwen/Qwen-Image-Edit-2509",
37
+ transformer=QwenImageTransformer2DModel.from_pretrained("linoyts/Qwen-Image-Edit-Rapid-AIO",
38
  subfolder='transformer',
39
  torch_dtype=dtype,
40
+ quantization_config=bnb_config,
41
+ device_map='auto'),
42
+ torch_dtype=dtype)
43
 
44
  pipe.load_lora_weights("rsshekhawat/Qwen-Edit-3DChibi-LoRA",
45
  weight_name="qwen_3d_chibi_lora_v1_000000820.safetensors",