英文

指导调整的稳定扩散用于低级图像处理(经过微调)

该流程是从现有的 InstructPix2Pix checkpoints 进行“指导调整”的版本。它是从现有的 InstructPix2Pix checkpoints 进行微调的。

流程描述

该流程的动机部分来自 FLAN ,部分来自 InstructPix2Pix 。主要思想是首先创建一个指导提示数据集(如 our blog 中所述),然后进行InstructPix2Pix风格的训练。最终目标是使稳定扩散更好地遵循涉及图像转换相关操作的特定指令。

详细了解请参阅 this post 。

训练过程和结果

在 instruction-tuning-sd/low-level-image-proc 数据集上进行了训练。有关详细信息,请参阅[此存储库]( https://github.com/huggingface/instruction-tuned-sd )。训练日志可在 here 中找到。

下面是从此流程中得出的一些结果:

使用目的和限制

您可以使用该流程对输入图像和输入提示进行低级图像处理。

使用方法

以下是如何使用此模型:

import torch
from diffusers import StableDiffusionInstructPix2PixPipeline
from diffusers.utils import load_image

model_id = "instruction-tuning-sd/low-level-img-proc"
pipeline = StableDiffusionInstructPix2PixPipeline.from_pretrained(
    model_id, torch_dtype=torch.float16, use_auth_token=True
).to("cuda")

image_path = "https://hf.co/datasets/sayakpaul/sample-datasets/resolve/main/derain%20the%20image_1.png"
image = load_image(image_path)

image = pipeline("derain the image", image=image).images[0]
image.save("image.png")

有关限制、误用、恶意使用和超出范围使用的注意事项,请参阅模型卡 here 。

引用

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},
}

用于稳定扩散的指导调整博客

@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},
}