Spaces:
Running
Running
ciover2024
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -4,8 +4,10 @@ import torch
|
|
4 |
#from diffusers import FluxControlNetModel
|
5 |
#from diffusers.pipelines import FluxControlNetPipeline
|
6 |
|
7 |
-
from diffusers import
|
8 |
-
|
|
|
|
|
9 |
|
10 |
"""
|
11 |
from diffusers import DiffusionPipeline
|
@@ -45,7 +47,8 @@ def load_inpainting_model():
|
|
45 |
|
46 |
# Load the model once globally to avoid repeated loading
|
47 |
def load_upscaling_model():
|
48 |
-
# Load pipeline
|
|
|
49 |
device = "cpu" # Explicitly use CPU
|
50 |
controlnet = FluxControlNetModel.from_pretrained(
|
51 |
"jasperai/Flux.1-dev-Controlnet-Upscaler",
|
@@ -56,6 +59,8 @@ def load_upscaling_model():
|
|
56 |
controlnet=controlnet,
|
57 |
torch_dtype=torch.float32
|
58 |
).to(device)
|
|
|
|
|
59 |
return pipe
|
60 |
|
61 |
# Preload the model once
|
|
|
4 |
#from diffusers import FluxControlNetModel
|
5 |
#from diffusers.pipelines import FluxControlNetPipeline
|
6 |
|
7 |
+
from diffusers import DiffusionPipeline
|
8 |
+
|
9 |
+
#from diffusers import FluxControlNetPipeline
|
10 |
+
#from diffusers import FluxControlNetModel #, FluxMultiControlNetModel
|
11 |
|
12 |
"""
|
13 |
from diffusers import DiffusionPipeline
|
|
|
47 |
|
48 |
# Load the model once globally to avoid repeated loading
|
49 |
def load_upscaling_model():
|
50 |
+
# Load pipeline
|
51 |
+
"""
|
52 |
device = "cpu" # Explicitly use CPU
|
53 |
controlnet = FluxControlNetModel.from_pretrained(
|
54 |
"jasperai/Flux.1-dev-Controlnet-Upscaler",
|
|
|
59 |
controlnet=controlnet,
|
60 |
torch_dtype=torch.float32
|
61 |
).to(device)
|
62 |
+
"""
|
63 |
+
pipe = DiffusionPipeline.from_pretrained("jasperai/Flux.1-dev-Controlnet-Upscaler")
|
64 |
return pipe
|
65 |
|
66 |
# Preload the model once
|