Update TextGen/router.py
Browse files- TextGen/router.py +4 -3
TextGen/router.py
CHANGED
@@ -53,7 +53,8 @@ class SongRequest(BaseModel):
|
|
53 |
class Message(BaseModel):
|
54 |
npc: str | None = None
|
55 |
messages: List[str] | None = None
|
56 |
-
|
|
|
57 |
class VoiceMessage(BaseModel):
|
58 |
npc: str | None = None
|
59 |
input: str | None = None
|
@@ -233,6 +234,6 @@ async def generate_song():
|
|
233 |
return infos
|
234 |
|
235 |
@app.post('/generate_image')
|
236 |
-
def Imagen(prompt):
|
237 |
-
image_bytes=generate_image(prompt)
|
238 |
return Response(content=image_bytes, media_type="image/png")
|
|
|
53 |
class Message(BaseModel):
|
54 |
npc: str | None = None
|
55 |
messages: List[str] | None = None
|
56 |
+
class ImageGen(BaseModel):
|
57 |
+
prompt: str | None = None
|
58 |
class VoiceMessage(BaseModel):
|
59 |
npc: str | None = None
|
60 |
input: str | None = None
|
|
|
234 |
return infos
|
235 |
|
236 |
@app.post('/generate_image')
|
237 |
+
def Imagen(prompt:ImageGen=None):
|
238 |
+
image_bytes=generate_image(ImageGen.prompt)
|
239 |
return Response(content=image_bytes, media_type="image/png")
|