Instructions to use diffusionbee/fooocus_inpainting with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use diffusionbee/fooocus_inpainting with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import AutoPipelineForInpainting from diffusers.utils import load_image # switch to "mps" for apple devices pipe = AutoPipelineForInpainting.from_pretrained("diffusionbee/fooocus_inpainting", dtype=torch.float16, device_map="cuda") img_url = "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png" mask_url = "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo_mask.png" image = load_image(img_url).resize((1024, 1024)) mask_image = load_image(mask_url).resize((1024, 1024)) prompt = "a tiger sitting on a park bench" generator = torch.Generator(device="cuda").manual_seed(0) image = pipe( prompt=prompt, image=image, mask_image=mask_image, guidance_scale=8.0, num_inference_steps=20, # steps between 15 and 30 work well for us strength=0.99, # make sure to use `strength` below 1.0 generator=generator, ).images[0] - Notebooks
- Google Colab
- Kaggle
Download text_encoder_2/config.json from diffusionbee/fooocus_inpainting: direct link, hf CLI and curl.
- Browser
- Download file 747 Bytes
-
https://huggingface.co/diffusionbee/fooocus_inpainting/resolve/main/text_encoder_2/config.json
- Command line
-
hf download hf://diffusionbee/fooocus_inpainting/text_encoder_2/config.json
-
curl -L -o config.json https://huggingface.co/diffusionbee/fooocus_inpainting/resolve/main/text_encoder_2/config.json
747 Bytes
| { | |
| "_name_or_path": "/myhome/.cache/huggingface/hub/models--diffusers--stable-diffusion-xl-1.0-inpainting-0.1/snapshots/115134f363124c53c7d878647567d04daf26e41e/text_encoder_2", | |
| "architectures": [ | |
| "CLIPTextModelWithProjection" | |
| ], | |
| "attention_dropout": 0.0, | |
| "bos_token_id": 0, | |
| "dropout": 0.0, | |
| "eos_token_id": 2, | |
| "hidden_act": "gelu", | |
| "hidden_size": 1280, | |
| "initializer_factor": 1.0, | |
| "initializer_range": 0.02, | |
| "intermediate_size": 5120, | |
| "layer_norm_eps": 1e-05, | |
| "max_position_embeddings": 77, | |
| "model_type": "clip_text_model", | |
| "num_attention_heads": 20, | |
| "num_hidden_layers": 32, | |
| "pad_token_id": 1, | |
| "projection_dim": 1280, | |
| "torch_dtype": "float16", | |
| "transformers_version": "4.31.0", | |
| "vocab_size": 49408 | |
| } | |