linoyts HF Staff commited on
Commit
fab4b60
·
verified ·
1 Parent(s): 136bbb9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -15
app.py CHANGED
@@ -76,8 +76,9 @@ MAX_SEED = np.iinfo(np.int32).max
76
 
77
  @spaces.GPU
78
  def infer(
79
- image_subject,image_background,
80
- prompt,
 
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.Image(label="Output Image", interactive=False)
144
  prompt_preview = gr.Textbox(label="Processed Prompt", interactive=False, visible=False)
145
 
146
- # gr.Examples(
147
- # examples=[
148
- # ["wednesday.png", "pexels-alipazani-2613260.jpg"],
149
-
150
- # ],
151
- # inputs=[image_subject,image_background],
152
- # outputs=[result,seed],
153
- # fn=infer,
154
- # cache_examples="lazy",
155
- # elem_id="examples"
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,