Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -76,8 +76,9 @@ MAX_SEED = np.iinfo(np.int32).max
|
|
| 76 |
|
| 77 |
@spaces.GPU
|
| 78 |
def infer(
|
| 79 |
-
image_subject,
|
| 80 |
-
|
|
|
|
| 81 |
seed=42,
|
| 82 |
randomize_seed=True,
|
| 83 |
true_guidance_scale=1,
|
|
@@ -102,7 +103,7 @@ def infer(
|
|
| 102 |
num_images_per_prompt=1,
|
| 103 |
).images[0]
|
| 104 |
|
| 105 |
-
return result, seed
|
| 106 |
|
| 107 |
|
| 108 |
|
|
@@ -140,20 +141,20 @@ with gr.Blocks(theme=gr.themes.Citrus(), css=css) as demo:
|
|
| 140 |
|
| 141 |
|
| 142 |
with gr.Column():
|
| 143 |
-
result = gr.
|
| 144 |
prompt_preview = gr.Textbox(label="Processed Prompt", interactive=False, visible=False)
|
| 145 |
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
|
| 149 |
-
|
| 150 |
-
|
| 151 |
-
|
| 152 |
-
|
| 153 |
-
|
| 154 |
-
|
| 155 |
-
|
| 156 |
-
|
| 157 |
|
| 158 |
inputs = [
|
| 159 |
image_subject,image_background, prompt,
|
|
|
|
| 76 |
|
| 77 |
@spaces.GPU
|
| 78 |
def infer(
|
| 79 |
+
image_subject,
|
| 80 |
+
image_background=None,
|
| 81 |
+
prompt="",
|
| 82 |
seed=42,
|
| 83 |
randomize_seed=True,
|
| 84 |
true_guidance_scale=1,
|
|
|
|
| 103 |
num_images_per_prompt=1,
|
| 104 |
).images[0]
|
| 105 |
|
| 106 |
+
return [image_subject,result], seed
|
| 107 |
|
| 108 |
|
| 109 |
|
|
|
|
| 141 |
|
| 142 |
|
| 143 |
with gr.Column():
|
| 144 |
+
result = gr.ImageSlider(label="Output Image", interactive=False)
|
| 145 |
prompt_preview = gr.Textbox(label="Processed Prompt", interactive=False, visible=False)
|
| 146 |
|
| 147 |
+
gr.Examples(
|
| 148 |
+
examples=[
|
| 149 |
+
["fusion_car.png"],["fusion_shoes.png"],
|
| 150 |
+
|
| 151 |
+
],
|
| 152 |
+
inputs=[image_subject,image_background],
|
| 153 |
+
outputs=[result,seed],
|
| 154 |
+
fn=infer,
|
| 155 |
+
cache_examples="lazy",
|
| 156 |
+
elem_id="examples"
|
| 157 |
+
)
|
| 158 |
|
| 159 |
inputs = [
|
| 160 |
image_subject,image_background, prompt,
|