Spaces:
Running
on
Zero
Running
on
Zero
oyly
commited on
Commit
Β·
56aad4b
1
Parent(s):
46d3522
set resize to 480
Browse files
app.py
CHANGED
@@ -237,7 +237,7 @@ def edit(brush_canvas, source_prompt, inversion_guidance,
|
|
237 |
print(f"Done in {t1 - t0:.1f}s.", f'Saving {output_path} .' if save else 'No saving files.')
|
238 |
t5.to(device)
|
239 |
clip.to(device)
|
240 |
-
|
241 |
return img
|
242 |
|
243 |
def get_v_src_masks(mask,width,height,device,txt_length=512):
|
@@ -276,7 +276,7 @@ def create_demo(model_name: str):
|
|
276 |
|
277 |
π¨ [<b>Examples</b>] Click our examples below, draw your mask and click the "Edit" button. <br>
|
278 |
π [<b>Note</b>] Due to limited resources in spaces, this demo may only support optimization steps = 1. <br>
|
279 |
-
π [<b>Note</b>] Due to limited resources in spaces, you may need to resize large images. <br>
|
280 |
If you need high resolution for better quality, go to https://github.com/oyly16/LORE for more usage with your own resource. <br>
|
281 |
"""
|
282 |
article = r"""
|
@@ -314,7 +314,7 @@ def create_demo(model_name: str):
|
|
314 |
denoise_guidance = gr.Slider(1.0, 10.0, 2.0, step=0.1, label="Denoise Guidance", interactive=not is_schnell)
|
315 |
noise_scale = gr.Slider(0.0, 1.0, 0.9, step=0.1, label="renoise scale")
|
316 |
seed = gr.Textbox('0', label="Seed (-1 for random)", visible=True)
|
317 |
-
resize_longside = gr.Textbox('
|
318 |
|
319 |
output_image = gr.Image(label="Generated Image")
|
320 |
gr.Markdown(article)
|
@@ -332,8 +332,8 @@ def create_demo(model_name: str):
|
|
332 |
# epoch = 10, 5, 2, but set to 1 due to zerogpu limit
|
333 |
examples=[
|
334 |
["examples/woman.png", "a young woman", 15, 12, "a young woman with a necklace", "necklace", "5", 1, 0.9, "3", "-1"],
|
335 |
-
["examples/car.png", "a taxi in a neon-lit street", 30, 24, "a race car in a neon-lit street", "race car", "1", 1, 0.1, "2388791121", "
|
336 |
-
["examples/cup.png", "a cup on a wooden table", 10, 8, "a wooden table", "table", "2", 1, 0, "0", "
|
337 |
],
|
338 |
inputs=[
|
339 |
brush_canvas,
|
|
|
237 |
print(f"Done in {t1 - t0:.1f}s.", f'Saving {output_path} .' if save else 'No saving files.')
|
238 |
t5.to(device)
|
239 |
clip.to(device)
|
240 |
+
torch.cuda.empty_cache()
|
241 |
return img
|
242 |
|
243 |
def get_v_src_masks(mask,width,height,device,txt_length=512):
|
|
|
276 |
|
277 |
π¨ [<b>Examples</b>] Click our examples below, draw your mask and click the "Edit" button. <br>
|
278 |
π [<b>Note</b>] Due to limited resources in spaces, this demo may only support optimization steps = 1. <br>
|
279 |
+
π [<b>Note</b>] Due to limited resources in spaces, you may need to resize large images <= 480. <br>
|
280 |
If you need high resolution for better quality, go to https://github.com/oyly16/LORE for more usage with your own resource. <br>
|
281 |
"""
|
282 |
article = r"""
|
|
|
314 |
denoise_guidance = gr.Slider(1.0, 10.0, 2.0, step=0.1, label="Denoise Guidance", interactive=not is_schnell)
|
315 |
noise_scale = gr.Slider(0.0, 1.0, 0.9, step=0.1, label="renoise scale")
|
316 |
seed = gr.Textbox('0', label="Seed (-1 for random)", visible=True)
|
317 |
+
resize_longside = gr.Textbox('480', label="Resize (only if input lager than this)(-1 for no resize)", visible=True)
|
318 |
|
319 |
output_image = gr.Image(label="Generated Image")
|
320 |
gr.Markdown(article)
|
|
|
332 |
# epoch = 10, 5, 2, but set to 1 due to zerogpu limit
|
333 |
examples=[
|
334 |
["examples/woman.png", "a young woman", 15, 12, "a young woman with a necklace", "necklace", "5", 1, 0.9, "3", "-1"],
|
335 |
+
["examples/car.png", "a taxi in a neon-lit street", 30, 24, "a race car in a neon-lit street", "race car", "1", 1, 0.1, "2388791121", "480"],
|
336 |
+
["examples/cup.png", "a cup on a wooden table", 10, 8, "a wooden table", "table", "2", 1, 0, "0", "480"],
|
337 |
],
|
338 |
inputs=[
|
339 |
brush_canvas,
|