Spaces:
Runtime error
Runtime error
seawolf2357
commited on
Commit
โข
77de8cc
1
Parent(s):
a27405a
Update app.py
Browse files
app.py
CHANGED
@@ -62,7 +62,7 @@ def translate_prompt(prompt):
|
|
62 |
async def generate_image(prompt, negative_prompt):
|
63 |
combined_prompt = f"{prompt}. {negative_prompt}"
|
64 |
try:
|
65 |
-
result = await asyncio.get_event_loop().run_in_executor(None, lambda: pipeline(
|
66 |
image = result.images[0] # ์ฒซ ๋ฒ์งธ ์ด๋ฏธ์ง ์ ํ
|
67 |
torch.cuda.empty_cache() # ๋ฉ๋ชจ๋ฆฌ ์ ๋ฆฌ
|
68 |
return image
|
@@ -88,7 +88,8 @@ async def generate_prompt_from_llm(user_input):
|
|
88 |
|
89 |
[์์] ๋ชฉ๋ก
|
90 |
!image ๋ฌผ์ ๋น ์ง ๋ฒ ๋๋ก๋ฅผ ๊บผ๋ด์ฃผ๋ ์์๋. ๋ฐ๋ค ๋ฐฐ๊ฒฝ. ์ด๊ณ ํด์๋ 4K. ๋ง์คํฐํผ์ค
|
91 |
-
!image
|
|
|
92 |
!image ์ฌ๊ธ๋ผ์ค ๋ผ๊ณ ์ผ๊ด์ํ๋ ํฌ๋ฉ๋ผ๋ฆฌ์ ๊ฐ์์ง. ๋ฐฐ๊ฒฝ ํด๋ณ
|
93 |
!image ์๋ฆ๋ค์ด 25์ธ ๋ฌ์์ ์ฌ์ ๋ชจ๋ธ. ์์๋ณต ์ฐฉ์ฉ. ๋ชจ๋ธ ํฌ์ฆ. ๋ฐ๋ค ๋ฐฐ๊ฒฝ. ์ด๊ณ ํด์๋ ์ฌ์ง ์คํ์ผ. ๋ฏธ์ ํ์ . ์ ๋ฉด ์์
|
94 |
!image 3D ํฝ์ฌ ์คํ์ผ. ๊ท์ฌ์ด ๊ณ ์ด๋์น. ๋ฐฐ๊ฒฝ ๋ถ์
|
@@ -162,7 +163,9 @@ class MyClient(discord.Client):
|
|
162 |
finally:
|
163 |
self.is_processing = False
|
164 |
else:
|
165 |
-
|
|
|
|
|
166 |
|
167 |
# ๋ด ์คํ
|
168 |
if __name__ == "__main__":
|
@@ -174,3 +177,4 @@ if __name__ == "__main__":
|
|
174 |
|
175 |
|
176 |
|
|
|
|
62 |
async def generate_image(prompt, negative_prompt):
|
63 |
combined_prompt = f"{prompt}. {negative_prompt}"
|
64 |
try:
|
65 |
+
result = await asyncio.get_event_loop().run_in_executor(None, lambda: pipeline(prompt, negative_prompt=negative_prompt))
|
66 |
image = result.images[0] # ์ฒซ ๋ฒ์งธ ์ด๋ฏธ์ง ์ ํ
|
67 |
torch.cuda.empty_cache() # ๋ฉ๋ชจ๋ฆฌ ์ ๋ฆฌ
|
68 |
return image
|
|
|
88 |
|
89 |
[์์] ๋ชฉ๋ก
|
90 |
!image ๋ฌผ์ ๋น ์ง ๋ฒ ๋๋ก๋ฅผ ๊บผ๋ด์ฃผ๋ ์์๋. ๋ฐ๋ค ๋ฐฐ๊ฒฝ. ์ด๊ณ ํด์๋ 4K. ๋ง์คํฐํผ์ค
|
91 |
+
!image ์๋ฆ๋ค์ด 20์ธ ํ๋์ค ์ฌ์ ๋ชจ๋ธ. ๊ณจํ ์จ์ด ์ฐฉ์ฉ. ๋ชจ๋ธ ํฌ์ฆ. ๊ณจํ์ฅ ๋ฐฐ๊ฒฝ. ๋ฏธ์ ํ์ . ์ ๋ฉด ์์. ๊ณ ํด์๋
|
92 |
+
!image ์๋ฆ๋ค์ด 20์ธ ์ฐํฌ๋ผ์ด๋ ์ฌ์ ๋ชจ๋ธ. ์คํฌ์ธ ์จ์ด ์ฐฉ์ฉ. ๋ชจ๋ธ ํฌ์ฆ. ๋ฐ๋ค ๋ฐฐ๊ฒฝ. ๋ฏธ์ ํ์ . ์ ๋ฉด ์์. ๊ณ ํด์๋
|
93 |
!image ์ฌ๊ธ๋ผ์ค ๋ผ๊ณ ์ผ๊ด์ํ๋ ํฌ๋ฉ๋ผ๋ฆฌ์ ๊ฐ์์ง. ๋ฐฐ๊ฒฝ ํด๋ณ
|
94 |
!image ์๋ฆ๋ค์ด 25์ธ ๋ฌ์์ ์ฌ์ ๋ชจ๋ธ. ์์๋ณต ์ฐฉ์ฉ. ๋ชจ๋ธ ํฌ์ฆ. ๋ฐ๋ค ๋ฐฐ๊ฒฝ. ์ด๊ณ ํด์๋ ์ฌ์ง ์คํ์ผ. ๋ฏธ์ ํ์ . ์ ๋ฉด ์์
|
95 |
!image 3D ํฝ์ฌ ์คํ์ผ. ๊ท์ฌ์ด ๊ณ ์ด๋์น. ๋ฐฐ๊ฒฝ ๋ถ์
|
|
|
163 |
finally:
|
164 |
self.is_processing = False
|
165 |
else:
|
166 |
+
# LLM์ ์ฌ์ฉํ์ฌ ๋ํ์ ์๋ต
|
167 |
+
response = await generate_prompt_from_llm(message.content)
|
168 |
+
await message.channel.send(response)
|
169 |
|
170 |
# ๋ด ์คํ
|
171 |
if __name__ == "__main__":
|
|
|
177 |
|
178 |
|
179 |
|
180 |
+
|