JOY-Huang commited on
Commit
ca9b0a2
1 Parent(s): bfa03fb

add examples

Browse files
app.py CHANGED
@@ -158,7 +158,6 @@ def instantir_restore(
158
  preview_start = preview_start / steps
159
 
160
  lq, out_size = resize_img(lq, width=width, height=height)
161
- print(out_size)
162
  lq = [lq]
163
  generator = torch.Generator(device=device).manual_seed(seed)
164
  timesteps = [
@@ -204,8 +203,9 @@ with gr.Blocks() as demo:
204
  ### **InstantIR can not only help you restore your broken image, but also capable of imaginative re-creation following your text prompts. See advance usage for more details!**
205
  ## Basic usage: revitalize your image
206
  1. Upload an image you want to restore;
207
- 2. Optionally, tune the `Steps` `CFG Scale` parameters. Typically higher steps lead to better results, but less than 50 is recommended for efficiency;
208
- 3. Click `InstantIR magic!`.
 
209
  """)
210
  with gr.Row():
211
  with gr.Column():
@@ -224,14 +224,16 @@ with gr.Blocks() as demo:
224
  preview_start = gr.Slider(label="Preview Start", value=0, minimum=0, maximum=30, step=1)
225
  mode = gr.Checkbox(label="Creative Restoration", value=False)
226
  prompt = gr.Textbox(label="Restoration prompts (Optional)", placeholder="")
227
- # gr.Examples(
228
- # examples = ["assets/lady.png", "assets/man.png", "assets/dog.png", "assets/panda.png", "assets/sculpture.png", "assets/cottage.png", "assets/Naruto.png", "assets/Konan.png"],
229
- # inputs = [lq_img]
230
- # )
231
  with gr.Column():
232
  output = gr.Image(label="InstantIR restored", type="pil")
233
  index = gr.Slider(label="Restoration Previews", value=29, minimum=0, maximum=29, step=1)
234
  preview = gr.Image(label="Preview", type="pil")
 
 
 
 
 
 
235
 
236
  pipe_out = gr.Gallery(visible=False)
237
  clear_btn.add([lq_img, output, preview])
 
158
  preview_start = preview_start / steps
159
 
160
  lq, out_size = resize_img(lq, width=width, height=height)
 
161
  lq = [lq]
162
  generator = torch.Generator(device=device).manual_seed(seed)
163
  timesteps = [
 
203
  ### **InstantIR can not only help you restore your broken image, but also capable of imaginative re-creation following your text prompts. See advance usage for more details!**
204
  ## Basic usage: revitalize your image
205
  1. Upload an image you want to restore;
206
+ 2. By default InstantIR will restore your image at original size, you can change output size by setting `Height` and `Width` according to your requirements;
207
+ 3. Optionally, tune the `Steps` `CFG Scale` parameters. Typically higher steps lead to better results, but less than 50 is recommended for efficiency;
208
+ 4. Click `InstantIR magic!`.
209
  """)
210
  with gr.Row():
211
  with gr.Column():
 
224
  preview_start = gr.Slider(label="Preview Start", value=0, minimum=0, maximum=30, step=1)
225
  mode = gr.Checkbox(label="Creative Restoration", value=False)
226
  prompt = gr.Textbox(label="Restoration prompts (Optional)", placeholder="")
 
 
 
 
227
  with gr.Column():
228
  output = gr.Image(label="InstantIR restored", type="pil")
229
  index = gr.Slider(label="Restoration Previews", value=29, minimum=0, maximum=29, step=1)
230
  preview = gr.Image(label="Preview", type="pil")
231
+ gr.Examples(
232
+ examples = [
233
+ "examples/wukong.png", "examples/lady.png", "examples/man.png", "examples/dog.png", "examples/panda.png", "examples/sculpture.png", "examples/cottage.png", "examples/Naruto.png", "examples/Konan.png"
234
+ ],
235
+ inputs = [lq_img]
236
+ )
237
 
238
  pipe_out = gr.Gallery(visible=False)
239
  clear_btn.add([lq_img, output, preview])
examples/Konan.png ADDED

Git LFS Details

  • SHA256: 96214bff76d8b9d9e44d86051dec53c71c88e6a2160961b5531df07adea3ba20
  • Pointer size: 130 Bytes
  • Size of remote file: 78.4 kB
examples/Naruto.png ADDED

Git LFS Details

  • SHA256: 832bf319ea41180ecaf4273753a8ce2e744b74895270164f7f635d30c2a1c0a3
  • Pointer size: 130 Bytes
  • Size of remote file: 91 kB
examples/cottage.png ADDED

Git LFS Details

  • SHA256: c89f992d1a764b622b3e94aa458e5b69832e3539cbd8ad7e5be8ad15ae986e5c
  • Pointer size: 131 Bytes
  • Size of remote file: 133 kB
examples/dog.png ADDED

Git LFS Details

  • SHA256: a3bf400c43191f2d6647ae743cc3bc1d8fdaede837d796d5e56d196fa47db714
  • Pointer size: 131 Bytes
  • Size of remote file: 715 kB
examples/lady.png ADDED

Git LFS Details

  • SHA256: 9cf913ad2daf7c0e8457905e36c8a4a16b693680dcc6b8426ea38b3ba53a6f0c
  • Pointer size: 130 Bytes
  • Size of remote file: 81.6 kB
examples/man.png ADDED

Git LFS Details

  • SHA256: 314ca2723982e51bf8bb288767bccb397b8151b0ab04c3b2c3a7878118eea99d
  • Pointer size: 130 Bytes
  • Size of remote file: 88.2 kB
examples/panda.png ADDED

Git LFS Details

  • SHA256: 6f77e6b8f1df25626f65a2cc0780d7ff9a1bb4a5fd977e9133f6e4e642df9481
  • Pointer size: 130 Bytes
  • Size of remote file: 61 kB
examples/sculpture.png ADDED

Git LFS Details

  • SHA256: 2c4af7c3dc545d2f48b0ac2afef69bd7b1f0489ced7ea452d92f69ff5a9d4019
  • Pointer size: 132 Bytes
  • Size of remote file: 1.2 MB
examples/wukong.png ADDED

Git LFS Details

  • SHA256: 4204661932afc7519926cf8d29bcb758072c1944ff45b41f5bc3d05cedd7defd
  • Pointer size: 131 Bytes
  • Size of remote file: 112 kB