当前位置:   article > 正文

sd_xl_turbo from_single_file 本地加载_diffusers from single file

diffusers from single file

  1. from diffusers import EulerAncestralDiscreteScheduler
  2. from diffusers import StableDiffusionXLPipeline
  3. import torch
  4. pipeline = StableDiffusionXLPipeline.from_single_file("sd_xl_turbo_1.0_fp16.safetensors",
  5. torch_dtype=torch.float16, variant="fp16")
  6. pipeline = pipeline.to("cuda")
  7. prompt = "A cinematic shot of a baby racoon wearing an intricate italian priest robe."
  8. scheduler_dict = {
  9. "beta_end": 0.012,
  10. "beta_schedule": "scaled_linear",
  11. "beta_start": 0.00085,
  12. "clip_sample": False,
  13. "interpolation_type": "linear",
  14. "num_train_timesteps": 1000,
  15. "prediction_type": "epsilon",
  16. "sample_max_value": 1.0,
  17. "set_alpha_to_one": False,
  18. "skip_prk_steps": True,
  19. "steps_offset": 1,
  20. "timestep_spacing": "trailing",
  21. "trained_betas": None,
  22. }
  23. pipeline.scheduler = EulerAncestralDiscreteScheduler.from_config(scheduler_dict)
  24. image = pipeline(prompt=prompt, guidance_scale=0.0, num_inference_steps=1, height=512, width=512).images[0]
  25. image.save('test.png')

声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:【wpsshop博客】
推荐阅读
相关标签
  

闽ICP备14008679号