Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -11,9 +11,7 @@ ckpt = "sdxl_lightning_4step_unet.safetensors"
|
|
| 11 |
# Load model.
|
| 12 |
unet = UNet2DConditionModel.from_config(base, subfolder="unet").to("cpu")
|
| 13 |
unet.load_state_dict(load_file(hf_hub_download(repo, ckpt), device="cpu"))
|
| 14 |
-
pipe = StableDiffusionXLPipeline.from_pretrained(base, unet=unet, torch_dtype=torch.float32
|
| 15 |
-
|
| 16 |
-
# Ensure sampler uses "trailing" timesteps.
|
| 17 |
pipe.scheduler = EulerDiscreteScheduler.from_config(pipe.scheduler.config, timestep_spacing="trailing")
|
| 18 |
|
| 19 |
def generate_images(prompt, num_inference_steps, guidance_scale, batch_size):
|
|
|
|
| 11 |
# Load model.
|
| 12 |
unet = UNet2DConditionModel.from_config(base, subfolder="unet").to("cpu")
|
| 13 |
unet.load_state_dict(load_file(hf_hub_download(repo, ckpt), device="cpu"))
|
| 14 |
+
pipe = StableDiffusionXLPipeline.from_pretrained(base, unet=unet, torch_dtype=torch.float32).to("cpu")
|
|
|
|
|
|
|
| 15 |
pipe.scheduler = EulerDiscreteScheduler.from_config(pipe.scheduler.config, timestep_spacing="trailing")
|
| 16 |
|
| 17 |
def generate_images(prompt, num_inference_steps, guidance_scale, batch_size):
|