Spaces:
Sleeping
Sleeping
Commit
·
bdd54be
1
Parent(s):
79043a8
push cuda check
Browse files
app.py
CHANGED
@@ -99,14 +99,16 @@ async def inpaint(
|
|
99 |
mask_image = mask_image.resize((width, height))
|
100 |
mask_image = mask_image.convert("L")
|
101 |
|
102 |
-
#
|
|
|
|
|
103 |
with torch.cuda.amp.autocast():
|
104 |
output_image = pipe(
|
105 |
prompt=prompt,
|
106 |
negative_prompt=negative_prompt,
|
107 |
image=original_image,
|
108 |
mask_image=mask_image,
|
109 |
-
num_inference_steps=
|
110 |
guidance_scale=7.5,
|
111 |
).images[0]
|
112 |
|
|
|
99 |
mask_image = mask_image.resize((width, height))
|
100 |
mask_image = mask_image.convert("L")
|
101 |
|
102 |
+
# Reduce steps for CPU
|
103 |
+
num_steps = 10 if not torch.cuda.is_available() else 20
|
104 |
+
|
105 |
with torch.cuda.amp.autocast():
|
106 |
output_image = pipe(
|
107 |
prompt=prompt,
|
108 |
negative_prompt=negative_prompt,
|
109 |
image=original_image,
|
110 |
mask_image=mask_image,
|
111 |
+
num_inference_steps=num_steps, # Reduced steps
|
112 |
guidance_scale=7.5,
|
113 |
).images[0]
|
114 |
|