来自社区的其他受欢迎的LoRA包括Kohya和TheLastBen。这些训练创建的LoRA检查点和扩散模型训练的方式不一样,但它们仍然可以以相同的方式加载。
import os os.environ["HF_ENDPOINT"] = "https://hf-mirror.com" rom diffusers import AutoPipelineForText2Image import torch pipeline = AutoPipelineForText2Image.from_pretrained("stabilityai/stable-diffusion-xl-base-1.0", torch_dtype=torch.float16).to("cuda") pipeline.load_lora_weights("TheLastBen/William_Eggleston_Style_SDXL", weight_name="wegg.safetensors") # use by william eggleston in the prompt to trigger the LoRA prompt = "a house by william eggleston, sunrays, beautiful, sunlight, sunrays, beautiful" image = pipeline(prompt=prompt).images[0]
image.save("load.jpg")