Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -85,12 +85,12 @@ def resize_image_old(image):
|
|
85 |
|
86 |
|
87 |
@spaces.GPU
|
88 |
-
def generate_(prompt, negative_prompt, pose_image, num_steps, controlnet_conditioning_scale, seed):
|
89 |
generator = torch.Generator("cuda").manual_seed(seed)
|
90 |
images = pipe(
|
91 |
prompt, negative_prompt=negative_prompt, image=pose_image, num_inference_steps=num_steps, controlnet_conditioning_scale=float(controlnet_conditioning_scale),
|
92 |
-
generator=generator, height=
|
93 |
-
).images
|
94 |
return images
|
95 |
|
96 |
@spaces.GPU
|
@@ -101,7 +101,7 @@ def process(input_image, prompt, negative_prompt, num_steps, controlnet_conditio
|
|
101 |
|
102 |
pose_image = openpose(input_image, include_body=True, include_hand=True, include_face=True)
|
103 |
|
104 |
-
images = generate_(prompt, negative_prompt, pose_image, num_steps, controlnet_conditioning_scale, seed)
|
105 |
|
106 |
return [pose_image,images[0]]
|
107 |
|
|
|
85 |
|
86 |
|
87 |
@spaces.GPU
|
88 |
+
def generate_(prompt, negative_prompt, pose_image, input_image, num_steps, controlnet_conditioning_scale, seed):
|
89 |
generator = torch.Generator("cuda").manual_seed(seed)
|
90 |
images = pipe(
|
91 |
prompt, negative_prompt=negative_prompt, image=pose_image, num_inference_steps=num_steps, controlnet_conditioning_scale=float(controlnet_conditioning_scale),
|
92 |
+
generator=generator, height=input_image.size[1], width=input_image.size[0],
|
93 |
+
).images
|
94 |
return images
|
95 |
|
96 |
@spaces.GPU
|
|
|
101 |
|
102 |
pose_image = openpose(input_image, include_body=True, include_hand=True, include_face=True)
|
103 |
|
104 |
+
images = generate_(prompt, negative_prompt, pose_image, input_image, num_steps, controlnet_conditioning_scale, seed)
|
105 |
|
106 |
return [pose_image,images[0]]
|
107 |
|