Spaces:
Paused
Paused
Fabrice-TIERCELIN
commited on
Commit
•
9744f65
1
Parent(s):
da69078
Log statistics
Browse files
app.py
CHANGED
@@ -413,16 +413,13 @@ def restore(
|
|
413 |
" pixels high, so a resolution of " + f'{result_width * result_height:,}' + " pixels."
|
414 |
print(information)
|
415 |
try:
|
416 |
-
print("
|
|
|
|
|
|
|
|
|
417 |
except Exception as e:
|
418 |
print('Exception of Estimation')
|
419 |
-
try:
|
420 |
-
unique_name = str(uuid.uuid4()) + "." + output_format
|
421 |
-
image_copy = Image.fromarray(np.array(results[0]))
|
422 |
-
image_copy.save(unique_name)
|
423 |
-
print(unique_name)
|
424 |
-
except Exception as e:
|
425 |
-
print('Exception printing the path: ' + str(e))
|
426 |
|
427 |
# Only one image can be shown in the slider
|
428 |
return [noisy_image] + [results[0]], gr.update(label="Downloadable results in *." + output_format + " format", format = output_format, value = results), gr.update(value = information, visible = True), gr.update(visible=True)
|
@@ -596,45 +593,6 @@ with gr.Blocks() as interface:
|
|
596 |
result_gallery = gr.Gallery(label = 'Downloadable results', show_label = True, elem_id = "gallery1")
|
597 |
|
598 |
gr.Examples(
|
599 |
-
run_on_click = True,
|
600 |
-
fn = stage2_process,
|
601 |
-
inputs = [
|
602 |
-
input_image,
|
603 |
-
rotation,
|
604 |
-
denoise_image,
|
605 |
-
prompt,
|
606 |
-
a_prompt,
|
607 |
-
n_prompt,
|
608 |
-
num_samples,
|
609 |
-
min_size,
|
610 |
-
downscale,
|
611 |
-
upscale,
|
612 |
-
edm_steps,
|
613 |
-
s_stage1,
|
614 |
-
s_stage2,
|
615 |
-
s_cfg,
|
616 |
-
randomize_seed,
|
617 |
-
seed,
|
618 |
-
s_churn,
|
619 |
-
s_noise,
|
620 |
-
color_fix_type,
|
621 |
-
diff_dtype,
|
622 |
-
ae_dtype,
|
623 |
-
gamma_correction,
|
624 |
-
linear_CFG,
|
625 |
-
linear_s_stage2,
|
626 |
-
spt_linear_CFG,
|
627 |
-
spt_linear_s_stage2,
|
628 |
-
model_select,
|
629 |
-
output_format,
|
630 |
-
allocation
|
631 |
-
],
|
632 |
-
outputs = [
|
633 |
-
result_slider,
|
634 |
-
result_gallery,
|
635 |
-
restore_information,
|
636 |
-
reset_btn
|
637 |
-
],
|
638 |
examples = [
|
639 |
[
|
640 |
"./Examples/Example1.png",
|
@@ -761,6 +719,45 @@ with gr.Blocks() as interface:
|
|
761 |
4
|
762 |
],
|
763 |
],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
764 |
cache_examples = False,
|
765 |
)
|
766 |
|
|
|
413 |
" pixels high, so a resolution of " + f'{result_width * result_height:,}' + " pixels."
|
414 |
print(information)
|
415 |
try:
|
416 |
+
print("Initial resolution: " + str(input_width * input_height))
|
417 |
+
print("Final resolution: " + str(result_width * result_height))
|
418 |
+
print("edm_steps: " + str(edm_steps))
|
419 |
+
print("num_samples: " + str(num_samples))
|
420 |
+
print("Estimated minutes: " + str(math.log(result_width * result_height * input_width * input_height * edm_steps * num_samples) / 10))
|
421 |
except Exception as e:
|
422 |
print('Exception of Estimation')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
423 |
|
424 |
# Only one image can be shown in the slider
|
425 |
return [noisy_image] + [results[0]], gr.update(label="Downloadable results in *." + output_format + " format", format = output_format, value = results), gr.update(value = information, visible = True), gr.update(visible=True)
|
|
|
593 |
result_gallery = gr.Gallery(label = 'Downloadable results', show_label = True, elem_id = "gallery1")
|
594 |
|
595 |
gr.Examples(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
596 |
examples = [
|
597 |
[
|
598 |
"./Examples/Example1.png",
|
|
|
719 |
4
|
720 |
],
|
721 |
],
|
722 |
+
run_on_click = True,
|
723 |
+
fn = stage2_process,
|
724 |
+
inputs = [
|
725 |
+
input_image,
|
726 |
+
rotation,
|
727 |
+
denoise_image,
|
728 |
+
prompt,
|
729 |
+
a_prompt,
|
730 |
+
n_prompt,
|
731 |
+
num_samples,
|
732 |
+
min_size,
|
733 |
+
downscale,
|
734 |
+
upscale,
|
735 |
+
edm_steps,
|
736 |
+
s_stage1,
|
737 |
+
s_stage2,
|
738 |
+
s_cfg,
|
739 |
+
randomize_seed,
|
740 |
+
seed,
|
741 |
+
s_churn,
|
742 |
+
s_noise,
|
743 |
+
color_fix_type,
|
744 |
+
diff_dtype,
|
745 |
+
ae_dtype,
|
746 |
+
gamma_correction,
|
747 |
+
linear_CFG,
|
748 |
+
linear_s_stage2,
|
749 |
+
spt_linear_CFG,
|
750 |
+
spt_linear_s_stage2,
|
751 |
+
model_select,
|
752 |
+
output_format,
|
753 |
+
allocation
|
754 |
+
],
|
755 |
+
outputs = [
|
756 |
+
result_slider,
|
757 |
+
result_gallery,
|
758 |
+
restore_information,
|
759 |
+
reset_btn
|
760 |
+
],
|
761 |
cache_examples = False,
|
762 |
)
|
763 |
|