more steps
Browse files
app.py
CHANGED
@@ -23,7 +23,7 @@ if preferred_device == "cuda":
|
|
23 |
|
24 |
inpainting_pipeline = AutoPipelineForInpainting.from_pretrained(
|
25 |
"runwayml/stable-diffusion-inpainting",
|
26 |
-
|
27 |
torch_dtype=preferred_dtype,
|
28 |
).to(preferred_device)
|
29 |
|
@@ -64,14 +64,14 @@ def app(img, prompt):
|
|
64 |
image=img,
|
65 |
mask_image=mask,
|
66 |
strength=0.95,
|
67 |
-
num_inference_steps=
|
68 |
).images[0]
|
69 |
end_time = datetime.now().timestamp()
|
70 |
draw = ImageDraw.Draw(overlay_img)
|
71 |
# replace spaces with newlines after many words to line break prompt
|
72 |
prompt = " ".join([prompt.split(" ")[i] if (i+1) % 5 else prompt.split(" ")[i] + "\n" for i in range(len(prompt.split(" ")))])
|
73 |
|
74 |
-
draw.text((50, 10), f"Old size: {old_size}\nTotal duration: {int(1000 * (end_time - start_time))}ms\nSegmentation {int(1000 * (mask_time - start_time))}ms / inpainting {int(1000 * (end_time - mask_time))} \n<{prompt}>", fill=(
|
75 |
return overlay_img
|
76 |
|
77 |
#ideally:
|
|
|
23 |
|
24 |
inpainting_pipeline = AutoPipelineForInpainting.from_pretrained(
|
25 |
"runwayml/stable-diffusion-inpainting",
|
26 |
+
variant="fp16",
|
27 |
torch_dtype=preferred_dtype,
|
28 |
).to(preferred_device)
|
29 |
|
|
|
64 |
image=img,
|
65 |
mask_image=mask,
|
66 |
strength=0.95,
|
67 |
+
num_inference_steps=50,
|
68 |
).images[0]
|
69 |
end_time = datetime.now().timestamp()
|
70 |
draw = ImageDraw.Draw(overlay_img)
|
71 |
# replace spaces with newlines after many words to line break prompt
|
72 |
prompt = " ".join([prompt.split(" ")[i] if (i+1) % 5 else prompt.split(" ")[i] + "\n" for i in range(len(prompt.split(" ")))])
|
73 |
|
74 |
+
draw.text((50, 10), f"Old size: {old_size}\nTotal duration: {int(1000 * (end_time - start_time))}ms\nSegmentation {int(1000 * (mask_time - start_time))}ms / inpainting {int(1000 * (end_time - mask_time))} \n<{prompt}>", fill=(123, 0, 123))
|
75 |
return overlay_img
|
76 |
|
77 |
#ideally:
|