Spaces:
Runtime error
Runtime error
phenomenon1981
commited on
Commit
•
bb5ac34
1
Parent(s):
7cce289
Update app.py
Browse files
app.py
CHANGED
@@ -7,9 +7,10 @@ import string
|
|
7 |
import time
|
8 |
from queue import Queue
|
9 |
from threading import Thread
|
|
|
10 |
|
11 |
|
12 |
-
text_gen=gr.Interface.load("spaces/
|
13 |
def get_prompts(prompt_text):
|
14 |
return text_gen("photo, " + prompt_text)
|
15 |
proc1=gr.Interface.load("models/dreamlike-art/dreamlike-photoreal-2.0")
|
@@ -39,7 +40,8 @@ def add_random_noise(prompt, noise_level=0.07):
|
|
39 |
noise_indices = random.sample(range(len(prompt)), num_noise_chars)
|
40 |
# Add noise to the selected characters
|
41 |
prompt_list = list(prompt)
|
42 |
-
|
|
|
43 |
for index in noise_indices:
|
44 |
prompt_list[index] = random.choice(noise_chars)
|
45 |
return "".join(prompt_list)
|
@@ -81,7 +83,7 @@ with gr.Blocks(css='style.css') as demo:
|
|
81 |
<a href="https://twitter.com/DavidJohnstonxx/">created by Phenomenon1981</a>.
|
82 |
</p>
|
83 |
<p style="margin-bottom: 10px; font-size: 98%">
|
84 |
-
❤️ Press the Like Button if you enjoy my space! ❤️</a
|
85 |
</p>
|
86 |
</div>
|
87 |
"""
|
|
|
7 |
import time
|
8 |
from queue import Queue
|
9 |
from threading import Thread
|
10 |
+
import emoji
|
11 |
|
12 |
|
13 |
+
text_gen=gr.Interface.load("spaces/Gustavosta/MagicPrompt-Stable-Diffusion")
|
14 |
def get_prompts(prompt_text):
|
15 |
return text_gen("photo, " + prompt_text)
|
16 |
proc1=gr.Interface.load("models/dreamlike-art/dreamlike-photoreal-2.0")
|
|
|
40 |
noise_indices = random.sample(range(len(prompt)), num_noise_chars)
|
41 |
# Add noise to the selected characters
|
42 |
prompt_list = list(prompt)
|
43 |
+
# Add numbers, special characters, and all emojis to the list of characters used to add noise
|
44 |
+
noise_chars = string.ascii_letters + string.punctuation + ' ' + string.digits + emoji.emojize(":all:")
|
45 |
for index in noise_indices:
|
46 |
prompt_list[index] = random.choice(noise_chars)
|
47 |
return "".join(prompt_list)
|
|
|
83 |
<a href="https://twitter.com/DavidJohnstonxx/">created by Phenomenon1981</a>.
|
84 |
</p>
|
85 |
<p style="margin-bottom: 10px; font-size: 98%">
|
86 |
+
❤️ Press the Like Button if you enjoy my space! ❤️</a>
|
87 |
</p>
|
88 |
</div>
|
89 |
"""
|