Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,5 +1,3 @@
|
|
1 |
-
# app.py
|
2 |
-
|
3 |
from fastapi import FastAPI
|
4 |
from pydantic import BaseModel
|
5 |
from diffusers import DiffusionPipeline
|
@@ -21,3 +19,8 @@ def generate_image(prompt: Prompt):
|
|
21 |
image = pipe(prompt.text).images[0]
|
22 |
image.save("output.png") # Enregistrer l'image générée
|
23 |
return {"message": "Image generated", "image_path": "output.png"}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
from fastapi import FastAPI
|
2 |
from pydantic import BaseModel
|
3 |
from diffusers import DiffusionPipeline
|
|
|
19 |
image = pipe(prompt.text).images[0]
|
20 |
image.save("output.png") # Enregistrer l'image générée
|
21 |
return {"message": "Image generated", "image_path": "output.png"}
|
22 |
+
|
23 |
+
# Point d'entrée pour Uvicorn
|
24 |
+
if __name__ == "__main__":
|
25 |
+
import uvicorn
|
26 |
+
uvicorn.run(app, host="0.0.0.0", port=8000)
|