Spaces:
Runtime error
Runtime error
Update app_merged.py
Browse files- app_merged.py +9 -5
app_merged.py
CHANGED
@@ -1751,15 +1751,19 @@ with gr.Blocks() as app:
|
|
1751 |
with gr.Column():
|
1752 |
prompt = gr.Textbox(label="Prompt")
|
1753 |
augment_prompt = gr.Button(value='Augment Prompt')
|
|
|
|
|
|
|
|
|
1754 |
|
1755 |
bg_source = gr.Radio(choices=[e.value for e in list(BGSource)[2:]],
|
1756 |
value=BGSource.LEFT.value,
|
1757 |
label="Lighting Preference (Initial Latent)", type='value')
|
|
|
1758 |
|
1759 |
example_quick_subjects = gr.Dataset(samples=quick_subjects, label='Subject Quick List', samples_per_page=1000, components=[prompt])
|
1760 |
example_quick_prompts = gr.Dataset(samples=quick_prompts, label='Lighting Quick List', samples_per_page=1000, components=[prompt])
|
1761 |
-
|
1762 |
-
relight_button = gr.Button(value="Relight")
|
1763 |
|
1764 |
with gr.Group(visible=False):
|
1765 |
with gr.Row():
|
@@ -1772,7 +1776,6 @@ with gr.Blocks() as app:
|
|
1772 |
|
1773 |
with gr.Accordion("Advanced options", open=False):
|
1774 |
steps = gr.Slider(label="Steps", minimum=1, maximum=100, value=15, step=1)
|
1775 |
-
cfg = gr.Slider(label="CFG Scale", minimum=1.0, maximum=32.0, value=2, step=0.01, visible=False)
|
1776 |
lowres_denoise = gr.Slider(label="Lowres Denoise (for initial latent)", minimum=0.1, maximum=1.0, value=0.9, step=0.01)
|
1777 |
highres_scale = gr.Slider(label="Highres Scale", minimum=1.0, maximum=3.0, value=1.5, step=0.01)
|
1778 |
highres_denoise = gr.Slider(label="Highres Denoise", minimum=0.1, maximum=1.0, value=0.5, step=0.01)
|
@@ -1804,7 +1807,7 @@ with gr.Blocks() as app:
|
|
1804 |
# outputs=[result_gallery, output_bg],
|
1805 |
# run_on_click=True, examples_per_page=1024
|
1806 |
# )
|
1807 |
-
augment_prompt.click(generate_description, inputs=[prompt,
|
1808 |
ips = [extracted_fg, prompt, image_width, image_height, num_samples, seed, steps, a_prompt, n_prompt, cfg, highres_scale, highres_denoise, lowres_denoise, bg_source]
|
1809 |
relight_button.click(fn=process_relight, inputs=ips, outputs=[result_gallery])
|
1810 |
example_quick_prompts.click(lambda x, y: ', '.join(y.split(', ')[:2] + [x[0]]), inputs=[example_quick_prompts, prompt], outputs=prompt, show_progress=False, queue=False)
|
@@ -1949,4 +1952,5 @@ with gr.Blocks() as app:
|
|
1949 |
)
|
1950 |
|
1951 |
if __name__ == "__main__":
|
1952 |
-
app.
|
|
|
|
1751 |
with gr.Column():
|
1752 |
prompt = gr.Textbox(label="Prompt")
|
1753 |
augment_prompt = gr.Button(value='Augment Prompt')
|
1754 |
+
|
1755 |
+
relight_button = gr.Button(value="Relight")
|
1756 |
+
|
1757 |
+
cfg = gr.Slider(label="Fidelity", minimum=1.0, maximum=32.0, value=2, step=0.01, visible=False)
|
1758 |
|
1759 |
bg_source = gr.Radio(choices=[e.value for e in list(BGSource)[2:]],
|
1760 |
value=BGSource.LEFT.value,
|
1761 |
label="Lighting Preference (Initial Latent)", type='value')
|
1762 |
+
|
1763 |
|
1764 |
example_quick_subjects = gr.Dataset(samples=quick_subjects, label='Subject Quick List', samples_per_page=1000, components=[prompt])
|
1765 |
example_quick_prompts = gr.Dataset(samples=quick_prompts, label='Lighting Quick List', samples_per_page=1000, components=[prompt])
|
1766 |
+
|
|
|
1767 |
|
1768 |
with gr.Group(visible=False):
|
1769 |
with gr.Row():
|
|
|
1776 |
|
1777 |
with gr.Accordion("Advanced options", open=False):
|
1778 |
steps = gr.Slider(label="Steps", minimum=1, maximum=100, value=15, step=1)
|
|
|
1779 |
lowres_denoise = gr.Slider(label="Lowres Denoise (for initial latent)", minimum=0.1, maximum=1.0, value=0.9, step=0.01)
|
1780 |
highres_scale = gr.Slider(label="Highres Scale", minimum=1.0, maximum=3.0, value=1.5, step=0.01)
|
1781 |
highres_denoise = gr.Slider(label="Highres Denoise", minimum=0.1, maximum=1.0, value=0.5, step=0.01)
|
|
|
1807 |
# outputs=[result_gallery, output_bg],
|
1808 |
# run_on_click=True, examples_per_page=1024
|
1809 |
# )
|
1810 |
+
augment_prompt.click(generate_description, inputs=[prompt, extracted_fg], outputs=[prompt])
|
1811 |
ips = [extracted_fg, prompt, image_width, image_height, num_samples, seed, steps, a_prompt, n_prompt, cfg, highres_scale, highres_denoise, lowres_denoise, bg_source]
|
1812 |
relight_button.click(fn=process_relight, inputs=ips, outputs=[result_gallery])
|
1813 |
example_quick_prompts.click(lambda x, y: ', '.join(y.split(', ')[:2] + [x[0]]), inputs=[example_quick_prompts, prompt], outputs=prompt, show_progress=False, queue=False)
|
|
|
1952 |
)
|
1953 |
|
1954 |
if __name__ == "__main__":
|
1955 |
+
app.queue(default_concurrency_limit=3)
|
1956 |
+
app.launch(share=True)
|