Instructions to use timbrooks/instruct-pix2pix with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use timbrooks/instruct-pix2pix with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline from diffusers.utils import load_image # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("timbrooks/instruct-pix2pix", dtype=torch.bfloat16, device_map="cuda") prompt = "Turn this cat into a dog" input_image = load_image("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/cat.png") image = pipe(image=input_image, prompt=prompt).images[0] - Notebooks
- Google Colab
- Kaggle
smaller model (pruned, fp16)
Please add the fp16 pruned version, it is very important for colab users
Yes please, it cant be used at the moment in free tier collabs
Just found one in the imaginairy repo https://huggingface.co/imaginairy/instruct-pix2pix/blob/main/instruct-pix2pix-00-22000-pruned.ckpt
Forget that it doesnt work in automatic, size error
@GDJ1978 & @hikow & @timbrooks :
The repo at webui/instruct-pix2pix has both a 4.27 GB pruned safetensor version and a 2.13 GB pruned fp16 safetensor version. I haven't tested either, though.
I tried converting the model myself using camenduru/converter but it didn't seem to support this model.
However, the conversion script from ShivamShrirao's fork of diffusers was able to produce both a 2.13 GB pruned fp16 ckpt version & safetensor version.
I pused these alongside the diffusers version of this model to johnslegers/instruct-pix2pix. I'll keep this repo public for the time being. Let me know if they work as expected. I haven't tested them myself yet.
@johnslegers , your pruned models works fine!