🚀 漫画化用の指示調整済みStable Diffusion (微調整済み)
このパイプラインは、Stable Diffusion (v1.5) の「指示調整済み」バージョンです。既存の InstructPix2Pix チェックポイント から微調整されています。
🚀 クイックスタート
このパイプラインのモチベーションは、一部 FLAN から、一部 InstructPix2Pix から来ています。主なアイデアは、まず指示付きのデータセットを作成し(私たちのブログ で説明されているように)、その後 InstructPix2Pix スタイルのトレーニングを行うことです。最終的な目的は、画像変換関連の操作を伴う特定の指示により適切に従うことができるように Stable Diffusion を改善することです。
詳細は この記事 を参照してください。
✨ 主な機能
トレーニング手順と結果
トレーニングは instruction-tuning-sd/cartoonization データセットで行われました。詳細は このリポジトリ を参照してください。トレーニングログは ここ で確認できます。
以下は、このパイプラインから得られたいくつかの結果です:
想定される用途と制限
このパイプラインは、入力画像と入力プロンプトを使用して漫画化を行うために使用できます。
💻 使用例
基本的な使用法
import torch
from diffusers import StableDiffusionInstructPix2PixPipeline
from diffusers.utils import load_image
model_id = "instruction-tuning-sd/cartoonizer"
pipeline = StableDiffusionInstructPix2PixPipeline.from_pretrained(
model_id, torch_dtype=torch.float16, use_auth_token=True
).to("cuda")
image_path = "https://hf.co/datasets/diffusers/diffusers-images-docs/resolve/main/mountain.png"
image = load_image(image_path)
image = pipeline("Cartoonize the following image", image=image).images[0]
image.save("image.png")
制限事項、誤用、悪意のある使用、想定外の使用に関する注意事項については、こちら のモデルカードを参照してください。
📚 ドキュメント
引用
FLAN
@inproceedings{
wei2022finetuned,
title={Finetuned Language Models are Zero-Shot Learners},
author={Jason Wei and Maarten Bosma and Vincent Zhao and Kelvin Guu and Adams Wei Yu and Brian Lester and Nan Du and Andrew M. Dai and Quoc V Le},
booktitle={International Conference on Learning Representations},
year={2022},
url={https://openreview.net/forum?id=gEZrGCozdqR}
}
InstructPix2Pix
@InProceedings{
brooks2022instructpix2pix,
author = {Brooks, Tim and Holynski, Aleksander and Efros, Alexei A.},
title = {InstructPix2Pix: Learning to Follow Image Editing Instructions},
booktitle = {CVPR},
year = {2023},
}
Instruction-tuning for Stable Diffusion blog
@article{
Paul2023instruction-tuning-sd,
author = {Paul, Sayak},
title = {Instruction-tuning Stable Diffusion with InstructPix2Pix},
journal = {Hugging Face Blog},
year = {2023},
note = {https://huggingface.co/blog/instruction-tuning-sd},
}
📄 ライセンス
このプロジェクトは MIT ライセンスの下で公開されています。