🚀 适用于Stable Diffusion的《华尔街日报》头像插画风格模型
本项目是一个微调后的Stable Diffusion模型,它能模仿《华尔街日报》(WSJ)为作者和主题创作独特肖像的风格。你只需使用 wsj hedcut of <subject> 这样的提示词,就能生成具有该报头像插画风格的图像。此外,该模型还能在DreamBooth环境中使用,用于训练特定人脸或其他主题,以生成定制化的独特头像插画。
🚀 快速开始
安装依赖库
代码示例
from diffusers import StableDiffusionPipeline
import torch
model_id = "dmillar/wsj-hedcut-v1"
pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16)
pipe = pipe.to("cuda")
prompt = "wsj hedcut of a woman"
image = pipe(prompt).images[0]
image.save("./woman_hedcut.png")
💻 使用示例
基础用法
上述代码展示了基础的使用方法,通过指定模型ID加载模型,设置提示词,然后生成图像并保存。
高级用法
在生成图像时,可以调整一些参数来获得不同的效果,例如示例图片中的参数设置。以下是一个示例:
from diffusers import StableDiffusionPipeline
import torch
model_id = "dmillar/wsj-hedcut-v1"
pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16)
pipe = pipe.to("cuda")
prompt = "wsj hedcut of audrey hepburn, portrait, detailed, sharp, black and white, pleasing, white background"
steps = 20
sampler = "Euler a"
cfg_scale = 7
seed = 231828633
generator = torch.Generator(device="cuda").manual_seed(seed)
image = pipe(prompt, num_inference_steps=steps, generator=generator, guidance_scale=cfg_scale).images[0]
image.save("./audrey_hepburn_hedcut.png")
📚 详细文档
示例图片
以下是使用该模型生成的一些示例图片及其对应的提示词和参数:
提示词: "wsj hedcut of audrey hepburn, portrait, detailed, sharp, black and white, pleasing, white background",步数: 20,采样器: "Euler a",CFG scale: 7,随机种子: 231828633
提示词: "wsj hedcut of the Kylian Mbappe, male, portrait, detailed, sharp, black and white, pleasing, white background",步数: 20,采样器: "Euler a",CFG scale: 7,随机种子: 1863052262
提示词: "wsj hedcut of tom hanks, portrait, detailed, sharp, black and white, pleasing, white background",步数: 20,采样器: Euler a,CFG scale: 7,随机种子: 224907260

注意事项
⚠️ 重要提示
如果你使用此模型,请尽力标明训练图像的主要艺术家Noli Novak,并遵守许可证要求的其他披露和限制。
📄 许可证
本模型使用的许可证为creativeml-openrail-m。
属性 |
详情 |
模型类型 |
微调后的Stable Diffusion模型 |
训练数据 |
未提及 |