模型:
这是由dreambooth进行了1万步微调的稳定扩散模型,使用了新海诚影片中的图像数据集。在您的提示中使用标记 makotoshinkaistyle 以获得这种效果。
这个模型可以像其他稳定扩散模型一样使用。详细信息请参阅 Stable Diffusion 。
您还可以将该模型导出到 ONNX 、 MPS 和/或 FLAX/JAX 。
from diffusers import StableDiffusionPipeline
import torch
import os
from PIL import Image
model_id = "michaelz/MakotoShinkai-Style-Diffusion"
pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float32)
pipe.requires_safety_checker = False
pipe.safety_checker = None
pipe = pipe.to("cuda")
save_dir = os.path.join("results")
os.makedirs(save_dir,exist_ok=True)
prompt_list = [
"MakotoShinkaiStyle, a beautiful sky",
"MakotoShinkaiStyle, a beautiful landscape",
"MakotoShinkaiStyle, a beautiful city"]
for prompt in prompt_list:
torch.manual_seed(-1)
image = pipe(prompt,width = 512,height = 512).images[0]
save_path = os.path.join(save_dir,prompt + ".png")
image.save(save_path)
版本1 (《新海诚风格扩散-1万步》): 这个模型是通过1万步训练得到的 dreambooth 创建的。