Views
No views yet


1import torch
2from diffusers import StableDiffusionInstructPix2PixPipeline
3from diffusers.utils import load_image
4
5model_id = "instruction-tuning-sd/scratch-low-level-img-proc"
6pipeline = StableDiffusionInstructPix2PixPipeline.from_pretrained(
7 model_id, torch_dtype=torch.float16, use_auth_token=True
8).to("cuda")
9
10image_path = "https://hf.co/datasets/sayakpaul/sample-datasets/resolve/main/derain%20the%20image_1.png"
11image = load_image(image_path)
12
13image = pipeline("derain the image", image=image).images[0]
14image.save("image.png")1@inproceedings{
2 wei2022finetuned,
3 title={Finetuned Language Models are Zero-Shot Learners},
4 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},
5 booktitle={International Conference on Learning Representations},
6 year={2022},
7 url={https://openreview.net/forum?id=gEZrGCozdqR}
8}1@InProceedings{
2 brooks2022instructpix2pix,
3 author = {Brooks, Tim and Holynski, Aleksander and Efros, Alexei A.},
4 title = {InstructPix2Pix: Learning to Follow Image Editing Instructions},
5 booktitle = {CVPR},
6 year = {2023},
7}1@article{
2 Paul2023instruction-tuning-sd,
3 author = {Paul, Sayak},
4 title = {Instruction-tuning Stable Diffusion with InstructPix2Pix},
5 journal = {Hugging Face Blog},
6 year = {2023},
7 note = {https://huggingface.co/blog/instruction-tuning-sd},
8}