Fabrice-TIERCELIN
commited on
Commit
•
583aaab
1
Parent(s):
607d49a
No more quota
Browse files
app.py
CHANGED
@@ -429,7 +429,7 @@ def restore_on_gpu(
|
|
429 |
print("edm_steps: " + str(edm_steps))
|
430 |
print("num_samples: " + str(num_samples))
|
431 |
print("downscale: " + str(downscale))
|
432 |
-
print("Estimated minutes: " + f'{(((result_width * result_height**(1/1.
|
433 |
except Exception as e:
|
434 |
print('Exception of Estimation')
|
435 |
|
@@ -490,11 +490,9 @@ title_html = """
|
|
490 |
<center><big><big>🤸<big><big><big><big><big><big>🤸</big></big></big></big></big></big></big></big></center>
|
491 |
|
492 |
<p>This is an online demo of SUPIR, a practicing model scaling for photo-realistic image restoration.
|
493 |
-
It is still a research project under tested and is not yet a stable commercial product.
|
494 |
The content added by SUPIR is <b><u>imagination, not real-world information</u></b>.
|
495 |
SUPIR is for beauty and illustration only.
|
496 |
-
Most of the processes
|
497 |
-
The process will be aborted if it lasts more than 10 min.
|
498 |
If you want to upscale AI-generated images, be noticed that <i>PixArt Sigma</i> space can directly generate 5984x5984 images.
|
499 |
Due to Gradio issues, the generated image is slightly less satured than the original.
|
500 |
Please leave a <a href="https://huggingface.co/spaces/Fabrice-TIERCELIN/SUPIR/discussions/new">message in discussion</a> if you encounter issues.
|
@@ -536,7 +534,6 @@ with gr.Blocks() as interface:
|
|
536 |
prompt = gr.Textbox(label="Image description", info="Help the AI understand what the image represents; describe as much as possible, especially the details we can't see on the original image; you can write in any language", value="", placeholder="A 33 years old man, walking, in the street, Santiago, morning, Summer, photorealistic", lines=3)
|
537 |
prompt_hint = gr.HTML("You can use a <a href='"'https://huggingface.co/spaces/MaziyarPanahi/llava-llama-3-8b'"'>LlaVa space</a> to auto-generate the description of your image.")
|
538 |
upscale = gr.Radio([["x1", 1], ["x2", 2], ["x3", 3], ["x4", 4], ["x5", 5], ["x6", 6], ["x7", 7], ["x8", 8], ["x9", 9], ["x10", 10]], label="Upscale factor", info="Resolution x1 to x10", value=2, interactive=True)
|
539 |
-
allocation = gr.Radio([["1 min", 1], ["2 min", 2], ["3 min", 3], ["4 min", 4], ["5 min", 5], ["6 min", 6], ["7 min", 7], ["8 min (discouraged)", 8], ["9 min (discouraged)", 9], ["10 min (discouraged)", 10]], label="GPU allocation time", info="lower=May abort run, higher=Quota penalty for next runs", value=7, interactive=True)
|
540 |
output_format = gr.Radio([["As input", "input"], ["*.png", "png"], ["*.webp", "webp"], ["*.jpeg", "jpeg"], ["*.gif", "gif"], ["*.bmp", "bmp"]], label="Image format for result", info="File extention", value="input", interactive=True)
|
541 |
|
542 |
with gr.Accordion("Pre-denoising (optional)", open=False):
|
@@ -595,6 +592,7 @@ with gr.Blocks() as interface:
|
|
595 |
interactive=True)
|
596 |
randomize_seed = gr.Checkbox(label = "\U0001F3B2 Randomize seed", value = True, info = "If checked, result is always different")
|
597 |
seed = gr.Slider(label="Seed", minimum=0, maximum=max_64_bit_int, step=1, randomize=True)
|
|
|
598 |
with gr.Group():
|
599 |
param_setting = gr.Radio(["Quality", "Fidelity"], interactive=True, label="Presetting", value = "Quality")
|
600 |
restart_button = gr.Button(value="Apply presetting")
|
|
|
429 |
print("edm_steps: " + str(edm_steps))
|
430 |
print("num_samples: " + str(num_samples))
|
431 |
print("downscale: " + str(downscale))
|
432 |
+
print("Estimated minutes: " + f'{(((result_width * result_height**(1/1.75)) * input_width * input_height * (edm_steps**(1/2)) * (num_samples**(1/2.5)))**(1/2.5)) / 25000:,}')
|
433 |
except Exception as e:
|
434 |
print('Exception of Estimation')
|
435 |
|
|
|
490 |
<center><big><big>🤸<big><big><big><big><big><big>🤸</big></big></big></big></big></big></big></big></center>
|
491 |
|
492 |
<p>This is an online demo of SUPIR, a practicing model scaling for photo-realistic image restoration.
|
|
|
493 |
The content added by SUPIR is <b><u>imagination, not real-world information</u></b>.
|
494 |
SUPIR is for beauty and illustration only.
|
495 |
+
Most of the processes last few minutes.
|
|
|
496 |
If you want to upscale AI-generated images, be noticed that <i>PixArt Sigma</i> space can directly generate 5984x5984 images.
|
497 |
Due to Gradio issues, the generated image is slightly less satured than the original.
|
498 |
Please leave a <a href="https://huggingface.co/spaces/Fabrice-TIERCELIN/SUPIR/discussions/new">message in discussion</a> if you encounter issues.
|
|
|
534 |
prompt = gr.Textbox(label="Image description", info="Help the AI understand what the image represents; describe as much as possible, especially the details we can't see on the original image; you can write in any language", value="", placeholder="A 33 years old man, walking, in the street, Santiago, morning, Summer, photorealistic", lines=3)
|
535 |
prompt_hint = gr.HTML("You can use a <a href='"'https://huggingface.co/spaces/MaziyarPanahi/llava-llama-3-8b'"'>LlaVa space</a> to auto-generate the description of your image.")
|
536 |
upscale = gr.Radio([["x1", 1], ["x2", 2], ["x3", 3], ["x4", 4], ["x5", 5], ["x6", 6], ["x7", 7], ["x8", 8], ["x9", 9], ["x10", 10]], label="Upscale factor", info="Resolution x1 to x10", value=2, interactive=True)
|
|
|
537 |
output_format = gr.Radio([["As input", "input"], ["*.png", "png"], ["*.webp", "webp"], ["*.jpeg", "jpeg"], ["*.gif", "gif"], ["*.bmp", "bmp"]], label="Image format for result", info="File extention", value="input", interactive=True)
|
538 |
|
539 |
with gr.Accordion("Pre-denoising (optional)", open=False):
|
|
|
592 |
interactive=True)
|
593 |
randomize_seed = gr.Checkbox(label = "\U0001F3B2 Randomize seed", value = True, info = "If checked, result is always different")
|
594 |
seed = gr.Slider(label="Seed", minimum=0, maximum=max_64_bit_int, step=1, randomize=True)
|
595 |
+
allocation = gr.Radio([["1 min", 1], ["2 min", 2], ["3 min", 3], ["4 min", 4], ["5 min", 5], ["6 min", 6], ["7 min", 7], ["8 min (discouraged)", 8], ["9 min (discouraged)", 9], ["10 min (discouraged)", 10]], label="GPU allocation time", info="lower=May abort run, higher=Quota penalty for next runs", value=7, interactive=True)
|
596 |
with gr.Group():
|
597 |
param_setting = gr.Radio(["Quality", "Fidelity"], interactive=True, label="Presetting", value = "Quality")
|
598 |
restart_button = gr.Button(value="Apply presetting")
|