anaksor-ocr
Sokheng · Kit
Reads Khmer and English text from documents, receipts and photos of signs, using a detector for text lines and a recogniser for each line. Suits developers who…
Generates photo-realistic images from text and fills masked areas of a picture, using Stable Diffusion with an extra mask input, in diffusers or AUTOMATIC1111. For designers, editors and developers.
stable-diffusion-inpainting is a kit in the Developer category, listed by Mindket. It is free. This is version 1, last updated on . Download it on this page, a zip of its files. Nothing in it runs by itself.
pip install -U huggingface_hub hf download stable-diffusion-v1-5/stable-diffusion-inpainting
This model works in latent space and uses diffusion to turn a text prompt into a realistic-looking picture. It can also repaint part of an existing picture, which you mark with a mask. This repository is a mirror of an older repository that is now deprecated, and the card says it has no affiliation with RunwayML. The card names Robin Rombach and Patrick Esser as developers.
It suits people who want to change one region of an image from a text description, such as designers, photo editors and app developers.
| Industry | Who uses it | How they use it | Example |
|---|---|---|---|
| Design | Illustrators and designers | Repaint one region of an image from a prompt | Putting a new subject into a masked spot of a scene |
| Photo editing | Retouchers | Replace or remove an object inside a mask | Swapping a masked item for something else |
| Software | App developers | Add region editing to an image application | Calling the diffusers pipeline from a backend |
| Research | Diffusion researchers | Study inpainting with extra mask input channels | Reading the card's training notes |
If you never need to edit part of an image, you can skip it.
| Use case | Who | What they get back |
|---|---|---|
| Region repainting | Designers | An image where only the masked area is redrawn |
| Object replacement | Editors | A picture with a masked object swapped for what the prompt describes |
| Scripted editing | Developers | A saved image file from a few lines of Python |
pip install -U huggingface_hub hf download stable-diffusion-v1-5/stable-diffusion-inpainting
Load the pipeline, then pass a prompt, an image and a mask. In the mask, white marks the area to repaint and black marks what stays as it is. The card's snippet uses torch without importing it, so add that import yourself.
from diffusers import StableDiffusionInpaintPipeline
pipe = StableDiffusionInpaintPipeline.from_pretrained(
"sd-legacy/stable-diffusion-inpainting",
revision="fp16",
torch_dtype=torch.float16,
)
prompt = "Face of a yellow cat, high resolution, sitting on a park bench"
#image and mask_image should be PIL images.
#The mask structure is white for inpainting and black for keeping as is
image = pipe(prompt=prompt, image=image, mask_image=mask_image).images[0]
image.save("./yellow_cat_on_park_bench.png")| Tool | What it does |
|---|---|
| StableDiffusionInpaintPipeline | Loads the inpainting model in diffusers |
| pipe | Takes the prompt, the image and the mask, and returns images |
| mask_image | Marks the area to repaint in white and the area to keep in black |
| AUTOMATIC1111 | A web interface that can run the same checkpoint |
You give the pipeline a photo of a park bench, a mask over the spot where something should appear, and a prompt asking for a yellow cat sitting there in high resolution. The masked area is filled with the cat, and the rest of the picture stays as it was.
Inpainting means redrawing only the part of a picture that you mask, guided by words. A good first try is to copy the snippet above, add a small photo and a mask, and write a short prompt.
Under the hood, the model started from Stable Diffusion v1.2 weights. Five input channels were added to the UNet. Four carry the masked image after encoding, one carries the mask, and all five begin with zero weights. During training, synthetic masks were generated, and in 25 percent of cases the mask covered everything. The text conditioning was dropped in 10 percent of samples to improve classifier-free guidance.
Generates photo-realistic images from text and fills masked areas of a picture, using Stable Diffusion with an extra mask input, in diffusers or AUTOMATIC1111. For designers, editors and developers.
Made by stable-diffusion-v1-5 on Hugging Face. These notes are Mindket's, written from its model page and model card; the model's own files and license are on Hugging Face.
What it is: This model works in latent space and uses diffusion to turn a text prompt into a realistic-looking picture. It can also repaint part of an existing picture, which you mark with a mask. This repository is a mirror of an older repository that is now deprecated, and the card says it has no affiliation with RunwayML. The card names Robin Rombach and Patrick Esser as developers.
Who it suits: It suits people who want to change one region of an image from a text description, such as designers, photo editors and app developers.
Industry | Who uses it | How they use it | Example
Design | Illustrators and designers | Repaint one region of an image from a prompt | Putting a new subject into a masked spot of a scene
Photo editing | Retouchers | Replace or remove an object inside a mask | Swapping a masked item for something else
Software | App developers | Add region editing to an image application | Calling the diffusers pipeline from a backend
Research | Diffusion researchers | Study inpainting with extra mask input channels | Reading the card's training notes
If you never need to edit part of an image, you can skip it.
Where to use it:
Use case | Who | What they get back
Region repainting | Designers | An image where only the masked area is redrawn
Object replacement | Editors | A picture with a masked object swapped for what the prompt describes
Scripted editing | Developers | A saved image file from a few lines of Python
How to set it up:
pip install -U huggingface_hub
hf download stable-diffusion-v1-5/stable-diffusion-inpainting
How to use it: Load the pipeline, then pass a prompt, an image and a mask. In the mask, white marks the area to repaint and black marks what stays as it is. The card's snippet uses torch without importing it, so add that import yourself.
from diffusers import StableDiffusionInpaintPipeline
pipe = StableDiffusionInpaintPipeline.from_pretrained(
"sd-legacy/stable-diffusion-inpainting",
revision="fp16",
torch_dtype=torch.float16,
)
prompt = "Face of a yellow cat, high resolution, sitting on a park bench"
#image and mask_image should be PIL images.
#The mask structure is white for inpainting and black for keeping as is
image = pipe(prompt=prompt, image=image, mask_image=mask_image).images[0]
image.save("./yellow_cat_on_park_bench.png")
Tool | What it does
StableDiffusionInpaintPipeline | Loads the inpainting model in diffusers
pipe | Takes the prompt, the image and the mask, and returns images
mask_image | Marks the area to repaint in white and the area to keep in black
AUTOMATIC1111 | A web interface that can run the same checkpoint
Example: You give the pipeline a photo of a park bench, a mask over the spot where something should appear, and a prompt asking for a yellow cat sitting there in high resolution. The masked area is filled with the cat, and the rest of the picture stays as it was.
For newcomers and experts: Inpainting means redrawing only the part of a picture that you mask, guided by words. A good first try is to copy the snippet above, add a small photo and a mask, and write a short prompt.
Under the hood, the model started from Stable Diffusion v1.2 weights. Five input channels were added to the UNet. Four carry the masked image after encoding, one carries the mask, and all five begin with zero weights. During training, synthetic masks were generated, and in 25 percent of cases the mask covered everything. The text conditioning was dropped in 10 percent of samples to improve classifier-free guidance.
Prompt, image and mask go in
UNet with 5 extra input channels
Masked area is redrawn
Edited image comes out
Good to know:
Title: Training steps in thousands
Regular training: 595 k steps
Inpainting training: 440 k steps
Download its files with Hugging Face's command line:
pip install -U huggingface_hub
hf download stable-diffusion-v1-5/stable-diffusion-inpainting
Then follow the usage in its model card. Nothing in this kit runs by itself.
README.md 6 KB
Listed Hugging Face models in the same category that share the most tags with this one.
| Product | Downloads, last 30 days | Likes | Parameters | License | Last change |
|---|---|---|---|---|---|
| stable-diffusion-inpainting This page | 248,486 | 122 | — | creativeml-openrail-m | |
| Stable Diffusion v1-5Shares stable-diffusion-diffusers · stable-diffusion · text-to-image | 1,012,982 | 1,364 | 860M | creativeml-openrail-m | |
| sd-vae-ft-mse-originalShares stable-diffusion-diffusers · stable-diffusion · text-to-image | 6 | 1,447 | — | mit | |
| stable-diffusion-xl-base-1.0Shares stable-diffusion · text-to-image · diffusers | 4,688,522 | 8,466 | 2.6B | openrail++ | |
| Animagine XL 4.0Shares stable-diffusion · text-to-image · diffusers | 1,026,807 | 582 | 2.6B | openrail++ | |
| Juggernaut XI v11Shares stable-diffusion · text-to-image · diffusers | 28,120 | 169 | — | cc-by-nc-nd-4.0 |
Sokheng · Kit
Reads Khmer and English text from documents, receipts and photos of signs, using a detector for text lines and a recogniser for each line. Suits developers who…
Qwen · Kit
Qwen2.5-7B-Instruct as GGUF files in eight quantization sizes, to chat with locally through llama.cpp. For people who want a capable 7.6B model on their own co…
ACE-Step · Kit
Generates music from text with a 4B diffusion decoder, 50 steps and guidance control, aiming for higher audio quality than the base. For creators with a GPU of…
alirezarezvani · Skill
Adds 411 ready-made skills for Claude Code and other coding agents, grouped by role from engineering and product to marketing, finance and compliance. Installs…
block · Kit
Self-hostable workspace where people and AI agents share the same rooms, built on a Nostr relay that logs every action as a signed event. For teams that want t…
backnotprop · Kit
Opens your AI coding agent's plans, specs and code changes in a browser so you can annotate or comment on them and send the feedback straight back to the agent.