Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -126,6 +126,7 @@ def end_session(req: gr.Request):
|
|
126 |
def preprocess_image(image: Image.Image,
|
127 |
prompt: str,
|
128 |
negative_prompt: str = "",
|
|
|
129 |
num_steps: int = 25,
|
130 |
guidance_scale: float = 5,
|
131 |
controlnet_conditioning_scale: float = 1.0,) -> Image.Image:
|
@@ -438,27 +439,27 @@ with gr.Blocks(delete_cache=(600, 600), js=js_func) as demo:
|
|
438 |
output_buf = gr.State()
|
439 |
|
440 |
# Example images at the bottom of the page
|
441 |
-
with gr.Row() as single_image_example:
|
442 |
-
|
443 |
-
|
444 |
-
|
445 |
-
|
446 |
-
|
447 |
-
|
448 |
-
|
449 |
-
|
450 |
-
|
451 |
-
|
452 |
-
|
453 |
-
with gr.Row(visible=False) as multiimage_example:
|
454 |
-
|
455 |
-
|
456 |
-
|
457 |
-
|
458 |
-
|
459 |
-
|
460 |
-
|
461 |
-
|
462 |
|
463 |
# Handlers
|
464 |
demo.load(start_session)
|
@@ -490,7 +491,7 @@ with gr.Blocks(delete_cache=(600, 600), js=js_func) as demo:
|
|
490 |
outputs=[seed],
|
491 |
).then(
|
492 |
preprocess_image,
|
493 |
-
inputs=[image_prompt, prompt],
|
494 |
outputs=[image_prompt],
|
495 |
).then(
|
496 |
image_to_3d,
|
|
|
126 |
def preprocess_image(image: Image.Image,
|
127 |
prompt: str,
|
128 |
negative_prompt: str = "",
|
129 |
+
style_name: "",
|
130 |
num_steps: int = 25,
|
131 |
guidance_scale: float = 5,
|
132 |
controlnet_conditioning_scale: float = 1.0,) -> Image.Image:
|
|
|
439 |
output_buf = gr.State()
|
440 |
|
441 |
# Example images at the bottom of the page
|
442 |
+
# with gr.Row() as single_image_example:
|
443 |
+
# examples = gr.Examples(
|
444 |
+
# examples=[
|
445 |
+
# f'assets/example_image/{image}'
|
446 |
+
# for image in os.listdir("assets/example_image")
|
447 |
+
# ],
|
448 |
+
# inputs=[image_prompt],
|
449 |
+
# fn=preprocess_image,
|
450 |
+
# outputs=[image_prompt],
|
451 |
+
# run_on_click=True,
|
452 |
+
# examples_per_page=64,
|
453 |
+
# )
|
454 |
+
# with gr.Row(visible=False) as multiimage_example:
|
455 |
+
# examples_multi = gr.Examples(
|
456 |
+
# examples=prepare_multi_example(),
|
457 |
+
# inputs=[image_prompt],
|
458 |
+
# fn=split_image,
|
459 |
+
# outputs=[multiimage_prompt],
|
460 |
+
# run_on_click=True,
|
461 |
+
# examples_per_page=8,
|
462 |
+
# )
|
463 |
|
464 |
# Handlers
|
465 |
demo.load(start_session)
|
|
|
491 |
outputs=[seed],
|
492 |
).then(
|
493 |
preprocess_image,
|
494 |
+
inputs=[image_prompt, prompt, negative_prompt, style],
|
495 |
outputs=[image_prompt],
|
496 |
).then(
|
497 |
image_to_3d,
|