Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -39,8 +39,9 @@ def generate_image(prompt, ckpt):
|
|
39 |
pipe.scheduler = LCMScheduler.from_config(pipe.scheduler.config, timestep_spacing="trailing", prediction_type="sample" if num_inference_steps==1 else "epsilon")
|
40 |
pipe.unet.load_state_dict(torch.load(hf_hub_download(repo, checkpoint), map_location="cuda"))
|
41 |
loaded = num_inference_steps
|
42 |
-
|
43 |
-
|
|
|
44 |
|
45 |
|
46 |
return results.images[0]
|
|
|
39 |
pipe.scheduler = LCMScheduler.from_config(pipe.scheduler.config, timestep_spacing="trailing", prediction_type="sample" if num_inference_steps==1 else "epsilon")
|
40 |
pipe.unet.load_state_dict(torch.load(hf_hub_download(repo, checkpoint), map_location="cuda"))
|
41 |
loaded = num_inference_steps
|
42 |
+
|
43 |
+
timesteps = [399] if num_inference_steps == 1 else []
|
44 |
+
results = pipe(prompt, num_inference_steps=num_inference_steps, guidance_scale=0, timesteps=timesteps)
|
45 |
|
46 |
|
47 |
return results.images[0]
|