Jordan Legg commited on
Commit
5e46cf5
β€’
1 Parent(s): aed3a85

fix: image pipeline arguments

Browse files
Files changed (2) hide show
  1. app.py +3 -1
  2. requirements.txt +2 -1
app.py CHANGED
@@ -22,6 +22,7 @@ def infer(prompt, init_image=None, seed=42, randomize_seed=False, width=1024, he
22
 
23
  if init_image is not None:
24
  # Process img2img
 
25
  init_image = pipe.preprocess(init_image).unsqueeze(0).to(device, dtype)
26
  image = pipe(
27
  prompt=prompt,
@@ -108,7 +109,7 @@ with gr.Blocks(css=css) as demo:
108
  run_button = gr.Button("Run", scale=0)
109
 
110
  with gr.Row():
111
- init_image = gr.Image(label="Initial Image (optional)", type="pil", optional=True)
112
  result = gr.Image(label="Result", show_label=False)
113
 
114
  with gr.Accordion("Advanced Settings", open=False):
@@ -162,3 +163,4 @@ with gr.Blocks(css=css) as demo:
162
  )
163
 
164
  demo.launch()
 
 
22
 
23
  if init_image is not None:
24
  # Process img2img
25
+ init_image = init_image.convert("RGB")
26
  init_image = pipe.preprocess(init_image).unsqueeze(0).to(device, dtype)
27
  image = pipe(
28
  prompt=prompt,
 
109
  run_button = gr.Button("Run", scale=0)
110
 
111
  with gr.Row():
112
+ init_image = gr.Image(label="Initial Image (optional)", type="pil")
113
  result = gr.Image(label="Result", show_label=False)
114
 
115
  with gr.Accordion("Advanced Settings", open=False):
 
163
  )
164
 
165
  demo.launch()
166
+
requirements.txt CHANGED
@@ -4,4 +4,5 @@ invisible_watermark
4
  torch
5
  transformers==4.42.4
6
  xformers
7
- sentencepiece
 
 
4
  torch
5
  transformers==4.42.4
6
  xformers
7
+ sentencepiece
8
+ gradio==4.29.0