Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -22,7 +22,7 @@ class ImageRequest(BaseModel): # Новая модель для запроса
|
|
| 22 |
is_public: bool = False
|
| 23 |
|
| 24 |
@app.post("/generate-image")
|
| 25 |
-
async def generate_image(request:
|
| 26 |
|
| 27 |
|
| 28 |
|
|
@@ -30,7 +30,7 @@ async def generate_image(request: ImageRequest):
|
|
| 30 |
try:
|
| 31 |
pipe = DiffusionPipeline.from_pretrained("black-forest-labs/FLUX.1-schnell")
|
| 32 |
|
| 33 |
-
prompt =
|
| 34 |
image = pipe(prompt).images[0]
|
| 35 |
|
| 36 |
return image
|
|
|
|
| 22 |
is_public: bool = False
|
| 23 |
|
| 24 |
@app.post("/generate-image")
|
| 25 |
+
async def generate_image(request: GenerationRequest):
|
| 26 |
|
| 27 |
|
| 28 |
|
|
|
|
| 30 |
try:
|
| 31 |
pipe = DiffusionPipeline.from_pretrained("black-forest-labs/FLUX.1-schnell")
|
| 32 |
|
| 33 |
+
prompt = request.prompt
|
| 34 |
image = pipe(prompt).images[0]
|
| 35 |
|
| 36 |
return image
|