Spaces:
Running
on
Zero
Running
on
Zero
add examples
Browse files- app.py +9 -7
- examples/Konan.png +3 -0
- examples/Naruto.png +3 -0
- examples/cottage.png +3 -0
- examples/dog.png +3 -0
- examples/lady.png +3 -0
- examples/man.png +3 -0
- examples/panda.png +3 -0
- examples/sculpture.png +3 -0
- examples/wukong.png +3 -0
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.
|
208 |
-
3.
|
|
|
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
|
examples/Naruto.png
ADDED
Git LFS Details
|
examples/cottage.png
ADDED
Git LFS Details
|
examples/dog.png
ADDED
Git LFS Details
|
examples/lady.png
ADDED
Git LFS Details
|
examples/man.png
ADDED
Git LFS Details
|
examples/panda.png
ADDED
Git LFS Details
|
examples/sculpture.png
ADDED
Git LFS Details
|
examples/wukong.png
ADDED
Git LFS Details
|