Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -5,19 +5,18 @@ from PIL import Image
|
|
| 5 |
import asyncio
|
| 6 |
import traceback
|
| 7 |
|
| 8 |
-
# Load the model with a
|
| 9 |
model = AutoPipelineForText2Image.from_pretrained("stabilityai/sdxl-turbo")
|
| 10 |
-
model.scheduler =
|
| 11 |
-
model.scheduler.config.prediction_type = "epsilon" # Adjust prediction_type
|
| 12 |
|
| 13 |
|
| 14 |
async def generate_image(prompt):
|
| 15 |
try:
|
| 16 |
-
num_inference_steps = 5 #
|
| 17 |
output = await asyncio.to_thread(
|
| 18 |
model,
|
| 19 |
prompt=prompt,
|
| 20 |
-
num_inference_steps=num_inference_steps,
|
| 21 |
guidance_scale=0.0,
|
| 22 |
output_type="pil"
|
| 23 |
)
|
|
|
|
| 5 |
import asyncio
|
| 6 |
import traceback
|
| 7 |
|
| 8 |
+
# Load the model with a different scheduler
|
| 9 |
model = AutoPipelineForText2Image.from_pretrained("stabilityai/sdxl-turbo")
|
| 10 |
+
model.scheduler = DPMSolverMultistepScheduler.from_config(model.scheduler.config) # Changed scheduler
|
|
|
|
| 11 |
|
| 12 |
|
| 13 |
async def generate_image(prompt):
|
| 14 |
try:
|
| 15 |
+
num_inference_steps = 5 # You can adjust this
|
| 16 |
output = await asyncio.to_thread(
|
| 17 |
model,
|
| 18 |
prompt=prompt,
|
| 19 |
+
num_inference_steps=num_inference_steps,
|
| 20 |
guidance_scale=0.0,
|
| 21 |
output_type="pil"
|
| 22 |
)
|