🚀 Hitokomoru Diffusion V2
Hitokomoru Diffusion V2 是一個基於文本生成圖像的模型,它在日本藝術家的作品上進行訓練,能夠根據文本提示生成高質量的動漫風格圖像,支持使用 Danbooru 標籤來生成特定風格的圖像。
🚀 快速開始
Hitokomoru Diffusion V2 是一個潛在擴散模型,它在日本藝術家 „Éí„Éà„Åì„ÇÇ„Çã/Hitokomoru 的作品上進行訓練。當前模型是基於 waifu-diffusion-1-4 (wd-1-4-anime_e2.ckpt
) 進行微調的,學習率為 2.0e-6
,訓練步數為 15000,批量大小為 4,使用從 Danbooru 收集的 257 幅藝術作品
進行訓練。該模型是 hitokomoru-diffusion 的延續,之前的版本是基於 Anything V3.0 進行微調的。數據集使用 Aspect Ratio Bucketing Tool 進行了預處理,以便可以轉換為潛在空間並在非方形分辨率下進行訓練。和其他動漫風格的 Stable Diffusion 模型一樣,它也支持使用 Danbooru 標籤來生成圖像。
例如:1girl, white hair, golden eyes, beautiful eyes, detail, flower meadow, cumulonimbus clouds, lighting, detailed sky, garden

✨ 主要特性
📦 安裝指南
使用 Automatic1111's Stable Diffusion Webui
使用 Diffusers
需要安裝以下依賴才能運行管道:
pip install diffusers transformers accelerate scipy safetensors
💻 使用示例
基礎用法
import torch
from torch import autocast
from diffusers import StableDiffusionPipeline, DPMSolverMultistepScheduler
model_id = "Linaqruf/hitokomoru-diffusion-v2"
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 = "worst quality, low quality, medium quality, deleted, lowres, comic, bad anatomy, bad hands, text, error, missing fingers, extra digit, fewer digits, cropped, 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")
高級用法
在使用時,需要根據 官方 Waifu Diffusion 1.4 發佈說明 調整提示詞,以獲得更高質量的圖像。
理想的負提示詞示例:
worst quality, low quality, medium quality, deleted, lowres, comic, bad anatomy, bad hands, text, error, missing fingers, extra digit, fewer digits, cropped, jpeg artifacts, signature, watermark, username, blurry
為了獲得高美學效果,提示詞前應添加以下內容:
masterpiece, best quality, high quality, absurdres
📚 詳細文檔
模型詳情
示例圖像的提示詞和設置
masterpiece, best quality, high quality, 1girl, solo, sitting, confident expression, long blonde hair, blue eyes, formal dress, jewelry, make-up, luxury, close-up, face, upper body.
Negative prompt: worst quality, low quality, medium quality, deleted, lowres, comic, bad anatomy, bad hands, text, error, missing fingers, extra digit, fewer digits, cropped, jpeg artifacts, signature, watermark, username, blurry
Steps: 20, Sampler: DPM++ 2M Karras, CFG scale: 7, Seed: 994051800, Size: 512x768, Model hash: ea61e913a0, Model: hitokomoru-v2, Batch size: 2, Batch pos: 0, Denoising strength: 0.6, Clip skip: 2, ENSD: 31337, Hires upscale: 1.5, Hires steps: 20, Hires upscaler: Latent (nearest-exact)
示例圖像

🔧 技術細節
該模型基於 waifu-diffusion-1-4 (wd-1-4-anime_e2.ckpt
) 進行微調,學習率為 2.0e-6
,訓練步數為 15000,批量大小為 4,使用從 Danbooru 收集的 257 幅藝術作品
進行訓練。數據集使用 Aspect Ratio Bucketing Tool 進行了預處理,以便可以轉換為潛在空間並在非方形分辨率下進行訓練。
📄 許可證
該模型是開放訪問的,所有人都可以使用,採用 CreativeML OpenRAIL-M 許可證進一步規定了權利和使用方式。
CreativeML OpenRAIL 許可證規定:
- 不得使用該模型故意生成或分享非法或有害的輸出或內容。
- 作者對生成的輸出不主張任何權利,用戶可以自由使用這些輸出,並對其使用負責,且使用不得違反許可證中的規定。
- 可以重新分發模型權重,並將模型用於商業用途和/或作為服務使用。如果這樣做,請務必包含與許可證中相同的使用限制,並向所有用戶分享一份 CreativeML OpenRAIL-M 許可證副本(請完整仔細閱讀許可證)。
請在此處閱讀完整許可證
致謝