Update app.py
Browse files
app.py
CHANGED
|
@@ -8,7 +8,7 @@ from queue import Queue
|
|
| 8 |
from threading import Thread
|
| 9 |
|
| 10 |
text_gen = gr.Interface.load("models/Gustavosta/MagicPrompt-Stable-Diffusion")
|
| 11 |
-
proc1 = gr.Interface.load("models/
|
| 12 |
|
| 13 |
def restart_script_periodically():
|
| 14 |
while True:
|
|
@@ -100,30 +100,7 @@ def get_prompts(prompt_text):
|
|
| 100 |
# Existing code...
|
| 101 |
|
| 102 |
with gr.Blocks(css=".gradio-container {background-color: #fdf7e6;} footer{display:none !important;}",) as demo:
|
| 103 |
-
|
| 104 |
-
<div style="text-align: center; max-width: 700px; margin: 0 auto;">
|
| 105 |
-
<div
|
| 106 |
-
style="
|
| 107 |
-
display: inline-flex;
|
| 108 |
-
align-items: center;
|
| 109 |
-
gap: 0.8rem;
|
| 110 |
-
font-size: 1.75rem;
|
| 111 |
-
"
|
| 112 |
-
>
|
| 113 |
-
<div>
|
| 114 |
-
<h1 style="font-weight: 900; margin-bottom: 7px; margin-top: 5px;">
|
| 115 |
-
Dreamlike Photoreal 2.0
|
| 116 |
-
</h1>
|
| 117 |
-
</div>
|
| 118 |
-
</div>
|
| 119 |
-
</div>
|
| 120 |
-
<p style="margin-bottom: 10px; font-size: 96%">
|
| 121 |
-
Noise Level: Controls how much randomness is added to the input before it is sent to the model. Higher noise level produces more diverse outputs, while lower noise level produces similar outputs,
|
| 122 |
-
|
| 123 |
-
</p>
|
| 124 |
-
|
| 125 |
-
</div>
|
| 126 |
-
""")
|
| 127 |
|
| 128 |
with gr.Column(elem_id="col-container"):
|
| 129 |
with gr.Row(variant="compact"):
|
|
@@ -158,32 +135,13 @@ with gr.Blocks(css=".gradio-container {background-color: #fdf7e6;} footer{displa
|
|
| 158 |
|
| 159 |
with gr.Row():
|
| 160 |
with gr.Row():
|
| 161 |
-
output1 = gr.Image(label="
|
| 162 |
-
|
| 163 |
|
| 164 |
see_prompts.click(get_prompts, inputs=[input_text], outputs=[prompt], queue=False)
|
| 165 |
run.click(send_it1, inputs=[prompt, noise_level], outputs=[output1])
|
| 166 |
run.click(send_it1, inputs=[prompt, noise_level], outputs=[output2])
|
| 167 |
-
|
| 168 |
-
<div class="footer" style="margin-bottom: 45px;
|
| 169 |
-
margin-top: 35px;
|
| 170 |
-
text-align: center;
|
| 171 |
-
border-bottom: 1px solid #e5e5e5"
|
| 172 |
-
>
|
| 173 |
-
<p style="font-size: .8rem;
|
| 174 |
-
display: inline-block;
|
| 175 |
-
padding: 0 10px;
|
| 176 |
-
transform: translateY(10px);
|
| 177 |
-
background: white" > Demo for <a href="https://huggingface.co/dreamlike-art/dreamlike-photoreal-2.0">Dreamlike Photoreal 2.0</a> Stable Diffusion model
|
| 178 |
-
</p>
|
| 179 |
-
</div>
|
| 180 |
-
<div class="acknowledgments" style="margin: 1.25em 0 .25em 0;
|
| 181 |
-
|
| 182 |
-
font-size: 96%">
|
| 183 |
-
<p> ❤️Unleash your creative side and generate mesmerizing images with just a few clicks! Enter a spark of inspiration in the "Basic Idea" text box and click the "Magic Prompt" button to elevate it to a polished masterpiece. Make any final tweaks in the "Full Prompt" box and hit the "Generate Images" button to watch your vision come to life. Experiment with the "Noise Level" for a diverse range of outputs, from similar to wildly unique. Let the fun begin!❤️
|
| 184 |
-
</p>
|
| 185 |
-
</div>
|
| 186 |
-
""")
|
| 187 |
|
| 188 |
|
| 189 |
demo.launch(enable_queue=True, inline=True)
|
|
|
|
| 8 |
from threading import Thread
|
| 9 |
|
| 10 |
text_gen = gr.Interface.load("models/Gustavosta/MagicPrompt-Stable-Diffusion")
|
| 11 |
+
proc1 = gr.Interface.load("models/playgroundai/playground-v2-1024px-aesthetic")
|
| 12 |
|
| 13 |
def restart_script_periodically():
|
| 14 |
while True:
|
|
|
|
| 100 |
# Existing code...
|
| 101 |
|
| 102 |
with gr.Blocks(css=".gradio-container {background-color: #fdf7e6;} footer{display:none !important;}",) as demo:
|
| 103 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 104 |
|
| 105 |
with gr.Column(elem_id="col-container"):
|
| 106 |
with gr.Row(variant="compact"):
|
|
|
|
| 135 |
|
| 136 |
with gr.Row():
|
| 137 |
with gr.Row():
|
| 138 |
+
output1 = gr.Image(label="", show_label=False, show_share_button=False)
|
| 139 |
+
|
| 140 |
|
| 141 |
see_prompts.click(get_prompts, inputs=[input_text], outputs=[prompt], queue=False)
|
| 142 |
run.click(send_it1, inputs=[prompt, noise_level], outputs=[output1])
|
| 143 |
run.click(send_it1, inputs=[prompt, noise_level], outputs=[output2])
|
| 144 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 145 |
|
| 146 |
|
| 147 |
demo.launch(enable_queue=True, inline=True)
|