Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -17,16 +17,9 @@ app = FastAPI(lifespan=lifespan)
|
|
| 17 |
|
| 18 |
class ImageRequest(BaseModel): # Новая модель для запроса
|
| 19 |
prompt: str = "girl in red dress"
|
| 20 |
-
model: str = "flux_1_schnell"
|
| 21 |
-
size: str = "1_1_HD"
|
| 22 |
-
is_public: bool = False
|
| 23 |
|
| 24 |
@app.post("/generate-image")
|
| 25 |
-
async def generate_image(request:
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
try:
|
| 31 |
pipe = DiffusionPipeline.from_pretrained("black-forest-labs/FLUX.1-schnell")
|
| 32 |
|
|
|
|
| 17 |
|
| 18 |
class ImageRequest(BaseModel): # Новая модель для запроса
|
| 19 |
prompt: str = "girl in red dress"
|
|
|
|
|
|
|
|
|
|
| 20 |
|
| 21 |
@app.post("/generate-image")
|
| 22 |
+
async def generate_image(request: ImageRequest):
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
try:
|
| 24 |
pipe = DiffusionPipeline.from_pretrained("black-forest-labs/FLUX.1-schnell")
|
| 25 |
|