"pipe = AutoPipelineForInpainting.from_pretrained(
""/data/xinkai_hu/model/runwayml/stable-diffusion-inpainting"",
torch_dtype=torch.float16,
variant=""fp16"",
).to(""cuda"")
pipe.scheduler = LCMScheduler.from_config(pipe.scheduler.config)
pipe.load_lora_weights(""/data/xinkai_hu/model/latent-consistency/lcm-lora-sdv1-5"")
pipe.fuse_lora()
image = pipe(
prompt=prompt,
image=init_image,
mask_image=mask_image,
generator=generator,
num_inference_steps=30,
guidance_scale=4,
).images[0]
ModelScope中,为什么画出来的图像素变低了?"
ModelScope旨在打造下一代开源的模型即服务共享平台,为泛AI开发者提供灵活、易用、低成本的一站式模型服务产品,让模型应用更简单!欢迎加入技术交流群:微信公众号:魔搭ModelScope社区,钉钉群号:44837352