赞
踩
- from diffusers import EulerAncestralDiscreteScheduler
- from diffusers import StableDiffusionXLPipeline
- import torch
-
- pipeline = StableDiffusionXLPipeline.from_single_file("sd_xl_turbo_1.0_fp16.safetensors",
- torch_dtype=torch.float16, variant="fp16")
- pipeline = pipeline.to("cuda")
-
- prompt = "A cinematic shot of a baby racoon wearing an intricate italian priest robe."
-
- scheduler_dict = {
- "beta_end": 0.012,
- "beta_schedule": "scaled_linear",
- "beta_start": 0.00085,
- "clip_sample": False,
- "interpolation_type": "linear",
- "num_train_timesteps": 1000,
- "prediction_type": "epsilon",
- "sample_max_value": 1.0,
- "set_alpha_to_one": False,
- "skip_prk_steps": True,
- "steps_offset": 1,
- "timestep_spacing": "trailing",
- "trained_betas": None,
- }
- pipeline.scheduler = EulerAncestralDiscreteScheduler.from_config(scheduler_dict)
- image = pipeline(prompt=prompt, guidance_scale=0.0, num_inference_steps=1, height=512, width=512).images[0]
- image.save('test.png')
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。