Spaces:
Runtime error
Runtime error
Update app.py
Browse files25 unmodified lines26272829303132333435293025 unmodified linesoutput_image = gr.Image(type="pil")demo = gr.Interface(fn=generate, inputs=[gr.Text, gr.slider], outputs=output_image)
if __name__ == "__main__": unet = UNet2DConditionModel.from_config(base, subfolder="unet").to("cuda", torch.float16) unet.load_state_dict(load_file(hf_hub_download(repo, ckpt), device="cuda")) pipe = StableDiffusionXLPipeline.from_pretrained(base, unet=unet, torch_dtype=torch.float16, variant="fp16").to("cuda") # Ensure sampler uses "trailing" timesteps and "sample" prediction type. pipe.scheduler = EulerDiscreteScheduler.from_config(pipe.scheduler.config, timestep_spacing="trailing", prediction_type="sample") demo.launch()
demo.launch()app.py+2-7