File size: 1,956 Bytes
b01886f
5fe0b68
 
 
 
b01886f
f070901
b01886f
 
 
 
 
5fe0b68
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
---
title: AI Image Fixer
emoji: 🎨
colorFrom: pink
colorTo: blue
sdk: gradio
sdk_version: 5.34.1
app_file: app.py
pinned: false
license: apache-2.0
---

# 🎨 AI Image Fixer (Inpainting)

This Hugging Face Space allows you to fix artifacts or undesirable parts of an AI-generated image using **inpainting**. If an image has weird hands, a distorted face, or other strange elements, you can simply mask them out and let the AI regenerate that specific area.

## How to Use

1.  **Upload Image**: Drag and drop or upload an image you want to fix.
2.  **Mask the Area**: Once uploaded, your cursor will become a brush. "Paint" over the parts of the image you want the AI to replace. You can adjust the brush size.
3.  **Write a Prompt**: In the "Prompt" box, describe what should be in the area you just painted. Be descriptive! For example, instead of "hair," try "realistic, flowing brown hair, detailed strands."
4.  **(Optional) Advanced Settings**:
    *   **Negative Prompt**: Describe what you *don't* want to see (e.g., `blurry, ugly, deformed, extra limbs`).
    *   **Guidance Scale**: Higher values make the AI follow your prompt more strictly. (7-9 is a good range).
    *   **Inference Steps**: More steps can lead to higher quality but take longer. (30-50 is usually sufficient).
5.  **Click "Fix It!"**: The model will process your request and display the fixed image on the right.

## Technical Details

-   **Model**: `stabilityai/stable-diffusion-2-inpainting`
-   **UI**: `Gradio`
-   **Backend**: `PyTorch` and the `diffusers` library.

## Limitations & Tips

-   **Blending**: The model does its best to blend the new content, but a seam may sometimes be visible. Trying again with a slightly different prompt can help.
-   **Prompt is Key**: The quality of the fix heavily depends on your prompt. Be specific!
-   **GPU Required**: This Space needs to run on GPU hardware (like a T4-small) to be fast. On a CPU, it will be very slow.