🚀 用於卡通化的指令調優穩定擴散模型(微調版)
本模型是 Stable Diffusion (v1.5) 的“指令調優”版本。它是在現有的 InstructPix2Pix 檢查點基礎上進行微調得到的。
🚀 快速開始
本模型可用於根據輸入圖像和輸入提示進行卡通化處理。以下是使用該模型的示例代碼:
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,部分源自 InstructPix2Pix。主要思路是先創建一個指令提示數據集(如我們的博客所述),然後進行 InstructPix2Pix 風格的訓練。最終目標是讓 Stable Diffusion 更好地遵循涉及圖像變換相關操作的特定指令。
更多信息請參考 此文章。
📚 詳細文檔
訓練過程和結果
訓練是在 instruction-tuning-sd/cartoonization 數據集上進行的。更多信息請參考 此倉庫。訓練日誌可在 這裡 找到。
以下是該模型生成的一些結果:
預期用途和侷限性
你可以使用該模型根據輸入圖像和輸入提示進行卡通化處理。關於侷限性、誤用、惡意使用、超出範圍使用的注意事項,請參考 此模型卡片。
📄 許可證
本項目採用 MIT 許可證。
📚 引用
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},
}
Stable Diffusion 指令調優博客
@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},
}