Spaces:
Running
on
A10G
Running
on
A10G
BertChristiaens
commited on
Commit
•
b12d9cc
1
Parent(s):
41e92f0
refactor
Browse files
models.py
CHANGED
@@ -201,18 +201,18 @@ def make_image_controlnet(image: np.ndarray,
|
|
201 |
flush()
|
202 |
|
203 |
image = Image.fromarray(image).convert("RGB")
|
204 |
-
controlnet_conditioning_image = Image.fromarray(controlnet_conditioning_image).convert("RGB")
|
205 |
mask_image = Image.fromarray((mask_image * 255).astype(np.uint8)).convert("RGB")
|
206 |
mask_image_postproc = convolution(mask_image)
|
207 |
|
208 |
|
209 |
-
st.success(f"{pipe.queue_size} images in the queue, can take up to {(pipe.queue_size
|
210 |
generated_image = pipe(
|
211 |
prompt=positive_prompt,
|
212 |
negative_prompt=negative_prompt,
|
213 |
num_inference_steps=20,
|
214 |
-
strength=
|
215 |
-
guidance_scale=
|
216 |
generator=[torch.Generator(device="cuda").manual_seed(seed)],
|
217 |
image=image,
|
218 |
mask_image=mask_image,
|
@@ -240,6 +240,7 @@ def make_inpainting(positive_prompt: str,
|
|
240 |
pipe = get_inpainting_pipeline()
|
241 |
|
242 |
flush()
|
|
|
243 |
image_ = pipe(image=image,
|
244 |
mask_image=Image.fromarray((mask_image * 255).astype(np.uint8)),
|
245 |
prompt=positive_prompt,
|
|
|
201 |
flush()
|
202 |
|
203 |
image = Image.fromarray(image).convert("RGB")
|
204 |
+
controlnet_conditioning_image = Image.fromarray(controlnet_conditioning_image).convert("RGB")#.filter(ImageFilter.GaussianBlur(radius = 9))
|
205 |
mask_image = Image.fromarray((mask_image * 255).astype(np.uint8)).convert("RGB")
|
206 |
mask_image_postproc = convolution(mask_image)
|
207 |
|
208 |
|
209 |
+
st.success(f"{pipe.queue_size} images in the queue, can take up to {(pipe.queue_size+1) * 10} seconds")
|
210 |
generated_image = pipe(
|
211 |
prompt=positive_prompt,
|
212 |
negative_prompt=negative_prompt,
|
213 |
num_inference_steps=20,
|
214 |
+
strength=1.00,
|
215 |
+
guidance_scale=7.0,
|
216 |
generator=[torch.Generator(device="cuda").manual_seed(seed)],
|
217 |
image=image,
|
218 |
mask_image=mask_image,
|
|
|
240 |
pipe = get_inpainting_pipeline()
|
241 |
|
242 |
flush()
|
243 |
+
st.success(f"{pipe.queue_size} images in the queue, can take up to {(pipe.queue_size+1) * 10} seconds")
|
244 |
image_ = pipe(image=image,
|
245 |
mask_image=Image.fromarray((mask_image * 255).astype(np.uint8)),
|
246 |
prompt=positive_prompt,
|