nick911 commited on
Commit
ec12b93
1 Parent(s): d8219f9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
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
- 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
 
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).images[0]
22
+ return images[0]
23
  # Ensure using the same inference steps as the loaded model and CFG set to 0.
24
 
25
  # @spaces.GPU