模型:
Anything V3.1是Anything V3.0的一个第三方延续模型。该模型声称是Anything V3.0的改进版本,固定了VAE模型和CLIP位置id密钥。CLIP参考来源于Stable Diffusion V1.5。VAE使用了Kohya的合并VAE脚本进行了交换,而CLIP则使用了Arena的stable-diffusion-model-toolkit webui扩展进行了修复。
Anything V3.2是Anything V3.1的续训模型。目前的模型经过了微调,学习率为2.0e-6,训练了50个周期,批次大小为4。数据集收集自多个来源,并进行了预处理,其中1/4为合成数据集。数据集使用了Aspect Ratio Bucketing Tool进行预处理,以便在非方形分辨率下进行转换和训练。这个模型是为了测试CLIP修复对训练的影响。和其他基于动漫风格的Stable Diffusion模型一样,它也支持使用Danbooru标签生成图像。
例如:1girl、white hair、golden eyes、beautiful eyes、detail、flower meadow、cumulonimbus clouds、lighting、detailed sky、garden
lowres, bad anatomy, bad hands, text, error, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality, normal quality, jpeg artifacts, signature, watermark, username, blurry
masterpiece, best quality, illustration, beautiful detailed, finely detailed, dramatic light, intricate details
这个模型可以像其他任何稳定扩散模型一样使用。有关更多信息,请参阅 Stable Diffusion 。您还可以将模型导出为 ONNX , MPS 和/或 FLAX/JAX 。预训练模型当前基于Anything V3.1。
您需要安装以下依赖项才能运行这个流程
pip install diffusers transformers accelerate scipy safetensors
运行流程(如果您没有更换调度程序,默认情况下将使用DDIM运行,在本示例中,我们将其更换为DPMSolverMultistepScheduler):
import torch
from torch import autocast
from diffusers import StableDiffusionPipeline, DPMSolverMultistepScheduler
model_id = "cag/anything-v3-1"
# Use the DPMSolverMultistepScheduler (DPM-Solver++) scheduler here instead
pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16)
pipe.scheduler = DPMSolverMultistepScheduler.from_config(pipe.scheduler.config)
pipe = pipe.to("cuda")
prompt = "masterpiece, best quality, high quality, 1girl, solo, sitting, confident expression, long blonde hair, blue eyes, formal dress"
negative_prompt = "lowres, bad anatomy, bad hands, text, error, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality, normal quality, jpeg artifacts, signature, watermark, username, blurry"
with autocast("cuda"):
image = pipe(prompt,
negative_prompt=negative_prompt,
width=512,
height=728,
guidance_scale=12,
num_inference_steps=50).images[0]
image.save("anime_girl.png")
这个模型过度拟合,无法很好地遵循提示,即使文本编码器已经修复。这导致提示变得懒散,您只能通过输入1girl来获得良好的结果。此外,这个模型是以动漫为基础的,对动漫女性角色有偏见。很难生成没有提供具体提示的男性角色。此外,与Anything V3.0基础模型相比,没有太多变化,只是涉及到VAE和CLIP模型的交换,然后在小规模数据集上进行了50个周期的微调。
以下是一些精选的样本和可用模型之间的比较
这个模型是开放访问的,可供所有人使用,采用CreativeML OpenRAIL-M许可证进一步规定权利和使用情况。CreativeML OpenRAIL许可证规定:
公有领域。