Update app.py
Browse files
app.py
CHANGED
|
@@ -14,12 +14,12 @@ def get_prompts(prompt_text):
|
|
| 14 |
if prompt_text:
|
| 15 |
return MagicPrompt('dreamlikeart, ' + prompt_text)
|
| 16 |
else:
|
| 17 |
-
|
| 18 |
logging.info('loading Dreamlike Diffusion')
|
| 19 |
-
DreamDiffusion=App.Interface.load('models/
|
| 20 |
logging.info('Loading Dreamlike PhotoReal')
|
| 21 |
DreamPhotoReal = DreamDiffusion
|
| 22 |
-
|
| 23 |
|
| 24 |
def RestartScript():
|
| 25 |
while True:
|
|
@@ -34,7 +34,8 @@ RestartThread.start()
|
|
| 34 |
queue = Queue()
|
| 35 |
queue_threshold = 100
|
| 36 |
|
| 37 |
-
def AddNoise(Prompt, NoiseLevel=0.00):
|
|
|
|
| 38 |
if NoiseLevel == 0:
|
| 39 |
NoiseLevel = 0.00
|
| 40 |
PercentageNoise = NoiseLevel * 5
|
|
@@ -145,7 +146,7 @@ with App.Blocks(css='style.css') as demo:
|
|
| 145 |
</h1>
|
| 146 |
</div>
|
| 147 |
<p style='margin-bottom: 10px; font-size: 96%'>
|
| 148 |
-
Dreamlike Diffusion 1.
|
| 149 |
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,
|
| 150 |
<a created by phenomenon1981</a>.
|
| 151 |
</p>
|
|
@@ -181,13 +182,22 @@ with App.Blocks(css='style.css') as demo:
|
|
| 181 |
prompt = App.Textbox(
|
| 182 |
label='Enter your prompt',
|
| 183 |
show_label=False,
|
| 184 |
-
max_lines=
|
| 185 |
placeholder='Full Prompt',
|
| 186 |
-
|
| 187 |
-
|
| 188 |
-
)
|
| 189 |
Run = App.Button('Generate Images').style(full_width=False)
|
| 190 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 191 |
with App.Row():
|
| 192 |
with App.Row():
|
| 193 |
NoiseLevel = App.Slider(minimum=0.1, maximum=3, step=0.1, label='Noise Level', value=0.5)
|
|
@@ -206,14 +216,14 @@ with App.Blocks(css='style.css') as demo:
|
|
| 206 |
|
| 207 |
SeePrompts.click(get_prompts, inputs=[input_text], outputs=[prompt], queue=False)
|
| 208 |
RandomPrompt.click(GetRandomPrompt, outputs=[prompt], queue=False)
|
| 209 |
-
Run.click(SendIt1, inputs=[prompt, NoiseLevel], outputs=[Output1])
|
| 210 |
-
Run.click(SendIt2, inputs=[prompt, NoiseLevel], outputs=[Output2])
|
| 211 |
-
Run.click(SendIt3, inputs=[prompt, NoiseLevel], outputs=[Output3])
|
| 212 |
-
Run.click(SendIt4, inputs=[prompt, NoiseLevel], outputs=[Output4])
|
| 213 |
-
Run.click(SendIt5, inputs=[prompt, NoiseLevel], outputs=[Output5])
|
| 214 |
-
Run.click(SendIt6, inputs=[prompt, NoiseLevel], outputs=[Output6])
|
| 215 |
-
Run.click(SendIt7, inputs=[prompt, NoiseLevel], outputs=[Output7])
|
| 216 |
-
Run.click(SendIt8, inputs=[prompt, NoiseLevel], outputs=[Output8])
|
| 217 |
|
| 218 |
|
| 219 |
with App.Row():
|
|
|
|
| 14 |
if prompt_text:
|
| 15 |
return MagicPrompt('dreamlikeart, ' + prompt_text)
|
| 16 |
else:
|
| 17 |
+
return MagicPrompt('')
|
| 18 |
logging.info('loading Dreamlike Diffusion')
|
| 19 |
+
DreamDiffusion=App.Interface.load('models/SG161222/Realistic_Vision_V1.4') # Credits to SG161222
|
| 20 |
logging.info('Loading Dreamlike PhotoReal')
|
| 21 |
DreamPhotoReal = DreamDiffusion
|
| 22 |
+
DreamPhotoReal=App.Interface.load('models/dreamlike-art/dreamlike-photoreal-2.0') # Credits to Dreamlike
|
| 23 |
|
| 24 |
def RestartScript():
|
| 25 |
while True:
|
|
|
|
| 34 |
queue = Queue()
|
| 35 |
queue_threshold = 100
|
| 36 |
|
| 37 |
+
def AddNoise(Prompt, neg_prompt, NoiseLevel=0.00):
|
| 38 |
+
|
| 39 |
if NoiseLevel == 0:
|
| 40 |
NoiseLevel = 0.00
|
| 41 |
PercentageNoise = NoiseLevel * 5
|
|
|
|
| 146 |
</h1>
|
| 147 |
</div>
|
| 148 |
<p style='margin-bottom: 10px; font-size: 96%'>
|
| 149 |
+
Dreamlike Diffusion 1.4 | Dreamlike PhotoReal 2.0
|
| 150 |
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,
|
| 151 |
<a created by phenomenon1981</a>.
|
| 152 |
</p>
|
|
|
|
| 182 |
prompt = App.Textbox(
|
| 183 |
label='Enter your prompt',
|
| 184 |
show_label=False,
|
| 185 |
+
max_lines=2,
|
| 186 |
placeholder='Full Prompt',
|
| 187 |
+
).style
|
| 188 |
+
( container=False, )
|
|
|
|
| 189 |
Run = App.Button('Generate Images').style(full_width=False)
|
| 190 |
+
|
| 191 |
+
with App.Row(variant='compact'):
|
| 192 |
+
neg_prompt = App.Textbox(
|
| 193 |
+
label='Enter your Negative prompt',
|
| 194 |
+
show_label=False,
|
| 195 |
+
max_lines=2,
|
| 196 |
+
placeholder='Full Negative Prompt',
|
| 197 |
+
).style
|
| 198 |
+
( container=False, )
|
| 199 |
+
Run = App.Button('Generate Images').style(full_width=False)
|
| 200 |
+
|
| 201 |
with App.Row():
|
| 202 |
with App.Row():
|
| 203 |
NoiseLevel = App.Slider(minimum=0.1, maximum=3, step=0.1, label='Noise Level', value=0.5)
|
|
|
|
| 216 |
|
| 217 |
SeePrompts.click(get_prompts, inputs=[input_text], outputs=[prompt], queue=False)
|
| 218 |
RandomPrompt.click(GetRandomPrompt, outputs=[prompt], queue=False)
|
| 219 |
+
Run.click(SendIt1, inputs=[prompt, neg_prompt, NoiseLevel], outputs=[Output1])
|
| 220 |
+
Run.click(SendIt2, inputs=[prompt, neg_prompt, NoiseLevel], outputs=[Output2])
|
| 221 |
+
Run.click(SendIt3, inputs=[prompt, neg_prompt, NoiseLevel], outputs=[Output3])
|
| 222 |
+
Run.click(SendIt4, inputs=[prompt, neg_prompt, NoiseLevel], outputs=[Output4])
|
| 223 |
+
Run.click(SendIt5, inputs=[prompt, neg_prompt, NoiseLevel], outputs=[Output5])
|
| 224 |
+
Run.click(SendIt6, inputs=[prompt, neg_prompt, NoiseLevel], outputs=[Output6])
|
| 225 |
+
Run.click(SendIt7, inputs=[prompt, neg_prompt, NoiseLevel], outputs=[Output7])
|
| 226 |
+
Run.click(SendIt8, inputs=[prompt, neg_prompt, NoiseLevel], outputs=[Output8])
|
| 227 |
|
| 228 |
|
| 229 |
with App.Row():
|