Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -33,8 +33,8 @@ def generate_(prompt, negative_prompt, control_tensor, num_steps, controlnet_con
|
|
33 |
image = control_tensor,
|
34 |
generator=generator
|
35 |
).images[0]
|
36 |
-
|
37 |
-
return
|
38 |
|
39 |
@spaces.GPU
|
40 |
def process(input_image, prompt, negative_prompt, num_steps, controlnet_conditioning_scale, seed):
|
@@ -43,9 +43,10 @@ def process(input_image, prompt, negative_prompt, num_steps, controlnet_conditio
|
|
43 |
mask = remove_bg_from_image(image)
|
44 |
control_tensor = get_control_image_tensor(pipe.vae, image, mask)
|
45 |
|
46 |
-
|
|
|
47 |
|
48 |
-
return [
|
49 |
|
50 |
|
51 |
|
|
|
33 |
image = control_tensor,
|
34 |
generator=generator
|
35 |
).images[0]
|
36 |
+
|
37 |
+
return gen_img
|
38 |
|
39 |
@spaces.GPU
|
40 |
def process(input_image, prompt, negative_prompt, num_steps, controlnet_conditioning_scale, seed):
|
|
|
43 |
mask = remove_bg_from_image(image)
|
44 |
control_tensor = get_control_image_tensor(pipe.vae, image, mask)
|
45 |
|
46 |
+
gen_image = generate_(prompt, negative_prompt, control_tensor, num_steps, controlnet_conditioning_scale, seed)
|
47 |
+
result_image = paste_fg_over_image(gen_image, image, mask)
|
48 |
|
49 |
+
return [mask ,result_image]
|
50 |
|
51 |
|
52 |
|