Spaces:
Running
on
Zero
Running
on
Zero
yonishafir
commited on
Commit
•
05f76db
1
Parent(s):
be0793a
Update app.py
Browse files
app.py
CHANGED
@@ -114,8 +114,8 @@ def predict(dict, prompt="", negative_prompt = default_negative_prompt, guidance
|
|
114 |
negative_prompt = None
|
115 |
|
116 |
|
117 |
-
init_image = dict["image"].convert("RGB").resize((1024, 1024))
|
118 |
-
mask = dict["mask"].convert("L").resize((1024, 1024))
|
119 |
|
120 |
width, height = get_size(init_image)
|
121 |
|
@@ -160,23 +160,13 @@ def predict(dict, prompt="", negative_prompt = default_negative_prompt, guidance
|
|
160 |
negative_prompt=negative_prompt,
|
161 |
image = masked_image, # control image V
|
162 |
init_image = init_image,
|
163 |
-
mask_image=mask_tensor,
|
164 |
-
guidance_scale=guidance_scale,
|
165 |
num_inference_steps=int(steps),
|
166 |
-
|
167 |
generator=generator,
|
168 |
controlnet_conditioning_sale=1.0)
|
169 |
|
170 |
-
# gen_img = pipe(negative_prompt=default_negative_prompt, prompt=prompt,
|
171 |
-
# controlnet_conditioning_sale=1.0,
|
172 |
-
# num_inference_steps=12,
|
173 |
-
# height=height, width=width,
|
174 |
-
# image = masked_image, # control image
|
175 |
-
# init_image = init_image,
|
176 |
-
# mask_image = mask_tensor,
|
177 |
-
# guidance_scale = 1.2,
|
178 |
-
# generator=generator).images[0]
|
179 |
-
|
180 |
torch.cuda.empty_cache
|
181 |
return output.images[0] #, gr.update(visible=True)
|
182 |
|
|
|
114 |
negative_prompt = None
|
115 |
|
116 |
|
117 |
+
# init_image = dict["image"].convert("RGB").resize((1024, 1024))
|
118 |
+
# mask = dict["mask"].convert("L").resize((1024, 1024))
|
119 |
|
120 |
width, height = get_size(init_image)
|
121 |
|
|
|
160 |
negative_prompt=negative_prompt,
|
161 |
image = masked_image, # control image V
|
162 |
init_image = init_image,
|
163 |
+
mask_image = mask_tensor,
|
164 |
+
guidance_scale = guidance_scale,
|
165 |
num_inference_steps=int(steps),
|
166 |
+
strength=strength,
|
167 |
generator=generator,
|
168 |
controlnet_conditioning_sale=1.0)
|
169 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
170 |
torch.cuda.empty_cache
|
171 |
return output.images[0] #, gr.update(visible=True)
|
172 |
|