Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -61,7 +61,16 @@ for each in nsfwlist:
|
|
61 |
nsfwlowerlist.append(each.lower())
|
62 |
nsfwlowerlist.extend(['bra','gay','lesbian',])
|
63 |
|
64 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
65 |
def generate_image(prompt_SD:str):
|
66 |
print(prompt_SD)
|
67 |
payload = {"inputs": prompt_SD,"seed":random.randint(0,1000),"negative_prompt":neg_prompt,"parameters": {
|
@@ -178,7 +187,7 @@ def getadvertisement(topic):
|
|
178 |
input_keyword='Abstract art with a splash of colors'
|
179 |
print(input_keyword)
|
180 |
print(datetime.today().strftime("%d-%m-%Y"))
|
181 |
-
prompt_SD=input_keyword+'
|
182 |
# generate image
|
183 |
image = generate_image(prompt_SD)
|
184 |
|
@@ -196,7 +205,7 @@ def getadvertisement(topic):
|
|
196 |
with gr.Blocks() as demo:
|
197 |
gr.Markdown("<h1><center>T-Shirt Design Generator</center></h1>")
|
198 |
gr.Markdown(
|
199 |
-
"""Enter a prompt and get the t-shirt design. Use examples as a guide. \nImage generation via Stable Diffusion 2. When prompt is not provided
|
200 |
)
|
201 |
with gr.Row() as row:
|
202 |
with gr.Column():
|
|
|
61 |
nsfwlowerlist.append(each.lower())
|
62 |
nsfwlowerlist.extend(['bra','gay','lesbian',])
|
63 |
|
64 |
+
data={"prompt_type":'stable_diffusion_negative_prompt',"hra_token":HRA_TOKEN}
|
65 |
+
try:
|
66 |
+
r = requests.post(url_hraprompts, data=json.dumps(data), headers=headers)
|
67 |
+
except requests.exceptions.ReadTimeout as e:
|
68 |
+
print(e)
|
69 |
+
#print(r.content)
|
70 |
+
|
71 |
+
neg_prompt=str(r.content, 'UTF-8')
|
72 |
+
print(neg_prompt)
|
73 |
+
|
74 |
def generate_image(prompt_SD:str):
|
75 |
print(prompt_SD)
|
76 |
payload = {"inputs": prompt_SD,"seed":random.randint(0,1000),"negative_prompt":neg_prompt,"parameters": {
|
|
|
187 |
input_keyword='Abstract art with a splash of colors'
|
188 |
print(input_keyword)
|
189 |
print(datetime.today().strftime("%d-%m-%Y"))
|
190 |
+
prompt_SD=input_keyword+' '+prompt_image
|
191 |
# generate image
|
192 |
image = generate_image(prompt_SD)
|
193 |
|
|
|
205 |
with gr.Blocks() as demo:
|
206 |
gr.Markdown("<h1><center>T-Shirt Design Generator</center></h1>")
|
207 |
gr.Markdown(
|
208 |
+
"""Enter a prompt and get the t-shirt design. Use examples as a guide. \nImage generation via Stable Diffusion 2. When a prompt is not provided the powerful AI model bigscience/bloom is used to generate it.\nNote: If there is an error message just try after 30 secs"""
|
209 |
)
|
210 |
with gr.Row() as row:
|
211 |
with gr.Column():
|