Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -18,8 +18,8 @@ def generate(prompt):
|
|
18 |
pipe = StableDiffusionXLPipeline.from_pretrained(base, unet=unet, torch_dtype=torch.float16, variant="fp16").to("cuda")
|
19 |
# Ensure sampler uses "trailing" timesteps and "sample" prediction type.
|
20 |
pipe.scheduler = EulerDiscreteScheduler.from_config(pipe.scheduler.config, timestep_spacing="trailing", prediction_type="sample")
|
21 |
-
|
22 |
-
|
23 |
# Ensure using the same inference steps as the loaded model and CFG set to 0.
|
24 |
|
25 |
# @spaces.GPU
|
|
|
18 |
pipe = StableDiffusionXLPipeline.from_pretrained(base, unet=unet, torch_dtype=torch.float16, variant="fp16").to("cuda")
|
19 |
# Ensure sampler uses "trailing" timesteps and "sample" prediction type.
|
20 |
pipe.scheduler = EulerDiscreteScheduler.from_config(pipe.scheduler.config, timestep_spacing="trailing", prediction_type="sample")
|
21 |
+
image = pipe(prompt, num_inference_steps=1, guidance_scale=0)
|
22 |
+
return image
|
23 |
# Ensure using the same inference steps as the loaded model and CFG set to 0.
|
24 |
|
25 |
# @spaces.GPU
|