Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -9,7 +9,7 @@ import urllib.parse
|
|
| 9 |
import asyncio
|
| 10 |
import aiohttp
|
| 11 |
import threading
|
| 12 |
-
|
| 13 |
|
| 14 |
app = FastAPI()
|
| 15 |
|
|
@@ -428,11 +428,10 @@ def sd3(prompt :str = "",
|
|
| 428 |
height: int = 1000
|
| 429 |
):
|
| 430 |
try:
|
| 431 |
-
|
| 432 |
-
image = client_sd3.text_to_image(prompt = f"{prompt} , {seed}, hd, high quality, 4k, masterpiece",
|
| 433 |
num_inference_steps = steps,
|
| 434 |
width = width, height = height )
|
| 435 |
-
return image
|
| 436 |
except Exception as e:
|
| 437 |
raise HTTPException(detail=f"Error during image generation: {e}")
|
| 438 |
|
|
|
|
| 9 |
import asyncio
|
| 10 |
import aiohttp
|
| 11 |
import threading
|
| 12 |
+
import PIL
|
| 13 |
|
| 14 |
app = FastAPI()
|
| 15 |
|
|
|
|
| 428 |
height: int = 1000
|
| 429 |
):
|
| 430 |
try:
|
| 431 |
+
image = client_sd3.text_to_image(prompt = f"{prompt}, hd, high quality, 4k, masterpiece",
|
|
|
|
| 432 |
num_inference_steps = steps,
|
| 433 |
width = width, height = height )
|
| 434 |
+
return image.save(f"{prompt}.jpg")
|
| 435 |
except Exception as e:
|
| 436 |
raise HTTPException(detail=f"Error during image generation: {e}")
|
| 437 |
|