Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -19,6 +19,7 @@ import boto3
|
|
19 |
from io import BytesIO
|
20 |
from datetime import datetime
|
21 |
from diffusers.utils import load_image, make_image_grid
|
|
|
22 |
|
23 |
import json
|
24 |
from preprocessor import Preprocessor
|
@@ -41,6 +42,7 @@ controlnet = FluxControlNetModel.from_pretrained(controlnet_model, torch_dtype=t
|
|
41 |
|
42 |
|
43 |
pipe = FluxControlNetInpaintPipeline.from_pretrained(base_model, controlnet=controlnet, torch_dtype=torch.bfloat16).to(device)
|
|
|
44 |
|
45 |
# pipe.enable_model_cpu_offload() # for saving memory
|
46 |
|
|
|
19 |
from io import BytesIO
|
20 |
from datetime import datetime
|
21 |
from diffusers.utils import load_image, make_image_grid
|
22 |
+
from lora_loading_patch import load_lora_into_transformer
|
23 |
|
24 |
import json
|
25 |
from preprocessor import Preprocessor
|
|
|
42 |
|
43 |
|
44 |
pipe = FluxControlNetInpaintPipeline.from_pretrained(base_model, controlnet=controlnet, torch_dtype=torch.bfloat16).to(device)
|
45 |
+
pipe.__class__.load_lora_into_transformer = classmethod(load_lora_into_transformer)
|
46 |
|
47 |
# pipe.enable_model_cpu_offload() # for saving memory
|
48 |
|