Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -66,7 +66,7 @@ login(HF_TOKEN)
|
|
66 |
|
67 |
SD = InferenceClient(model="stabilityai/stable-diffusion-2-1")
|
68 |
LLM = InferenceClient(model="openchat/openchat-3.5-0106")
|
69 |
-
RF = InferenceClient(model="stabilityai/stable-diffusion-xl-refiner-1.0"
|
70 |
|
71 |
|
72 |
def ec(x, fd="<|image|>", sd="<|image|>"):
|
@@ -198,18 +198,17 @@ async def on_message(message):
|
|
198 |
)
|
199 |
e = await message.reply(embed=embed)
|
200 |
print(imgp)
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
await e.edit(embed=embed, attachments=[file])
|
213 |
|
214 |
|
215 |
except Exception as e:
|
|
|
66 |
|
67 |
SD = InferenceClient(model="stabilityai/stable-diffusion-2-1")
|
68 |
LLM = InferenceClient(model="openchat/openchat-3.5-0106")
|
69 |
+
RF = InferenceClient(model="stabilityai/stable-diffusion-xl-refiner-1.0")
|
70 |
|
71 |
|
72 |
def ec(x, fd="<|image|>", sd="<|image|>"):
|
|
|
198 |
)
|
199 |
e = await message.reply(embed=embed)
|
200 |
print(imgp)
|
201 |
+
embed.set_image(url=load)
|
202 |
+
image = SD.text_to_image(imgp)
|
203 |
+
image.save("image.png")
|
204 |
+
image = RF.image_to_image("image.png")
|
205 |
+
if image["warnings"]:
|
206 |
+
print(image)
|
207 |
+
return 0
|
208 |
+
image.save("image.png")
|
209 |
+
file = discord.File("image.png", filename="image.png")
|
210 |
+
embed.set_image(url="attachment://image.png")
|
211 |
+
await e.edit(embed=embed, attachments=[file])
|
|
|
212 |
|
213 |
|
214 |
except Exception as e:
|