Spaces:
Sleeping
Sleeping
load_model
Browse files
app.py
CHANGED
@@ -19,6 +19,8 @@ def load_model():
|
|
19 |
controlnet=ControlNetModel.from_pretrained("yeq6x/Image2PositionColor_v3"),
|
20 |
).to("cuda")
|
21 |
pipe.scheduler = EulerAncestralDiscreteScheduler.from_config(pipe.scheduler.config)
|
|
|
|
|
22 |
|
23 |
def convert_pil_to_opencv(pil_image):
|
24 |
return np.array(pil_image)
|
@@ -134,9 +136,6 @@ def outpaint_image(image):
|
|
134 |
|
135 |
@spaces.GPU
|
136 |
def predict_image(cond_image, prompt, negative_prompt):
|
137 |
-
if pipe is None:
|
138 |
-
load_model()
|
139 |
-
|
140 |
generator = torch.Generator()
|
141 |
generator.manual_seed(random.randint(0, 2147483647))
|
142 |
|
|
|
19 |
controlnet=ControlNetModel.from_pretrained("yeq6x/Image2PositionColor_v3"),
|
20 |
).to("cuda")
|
21 |
pipe.scheduler = EulerAncestralDiscreteScheduler.from_config(pipe.scheduler.config)
|
22 |
+
|
23 |
+
load_model()
|
24 |
|
25 |
def convert_pil_to_opencv(pil_image):
|
26 |
return np.array(pil_image)
|
|
|
136 |
|
137 |
@spaces.GPU
|
138 |
def predict_image(cond_image, prompt, negative_prompt):
|
|
|
|
|
|
|
139 |
generator = torch.Generator()
|
140 |
generator.manual_seed(random.randint(0, 2147483647))
|
141 |
|