enInpainting Guide

Inpainting Guide

Introduction

Inpainting is a powerful feature that allows you to selectively edit and modify specific areas of your generated images. You can use it to remove unwanted elements, add new details, or change certain aspects of an image while preserving the rest.

Inpainting Example

How to Access the Inpainting Feature

To access the inpainting feature:

  1. Select any image in your gallery
  2. Click on the image to open the preview panel
  3. In the actions toolbar, click on the Inpaint button (paintbrush icon)
// The inpaint button is only available for original images, not for upscaled images
<Button
  variant="ghost"
  size="icon"
  onClick={handleOpenInpaintEditor}
  disabled={!canInpaint || isInpainting}
  aria-label="Inpaint"
>
  <Paintbrush className="w-5 h-5" />
</Button>

Image Types and Inpainting

The inpainting feature works with different types of images according to these rules:

Image TypeCan Be InpaintedCan Be Upscaled
Original✅ Yes✅ Yes
Inpainted✅ Yes✅ Yes
Upscaled❌ No❌ No

Note: You can create a workflow where you first inpaint an image and then upscale the inpainted version. The system will track this relationship and display it as an “Upscaled Inpaint”.

Using the Inpainting Editor

Basic Controls

The inpainting editor provides the following tools:

  • Brush: Paint over areas you want to change
  • Eraser: Remove brush marks
  • Brush Size: Adjust the size of the brush/eraser
  • Creativity: Control how much creative freedom the AI has when inpainting

Inpainting Editor Interface

Step-by-Step Guide

  1. Select the Area: Use the brush to paint over the areas you want to modify. The marked area will be highlighted.

  2. Adjust Brush Size: Use the slider to adjust the brush size for more precision or larger coverage.

  3. Custom Prompt (Optional): You can provide a specific prompt to guide how the selected area should be modified. If left empty, the system will attempt to match the style of the rest of the image.

  4. Advanced Settings: Expand this section to access additional options:

    • LoRA Model: Select a specific LoRA model for the inpainting operation
    • LoRA Weight: Adjust the influence of the selected LoRA
  5. Apply Inpainting: Click the “Apply Inpaint” button to process your request.

<Tabs defaultValue="settings">
  <TabsList>
    <TabsTrigger value="settings">Settings</TabsTrigger>
    <TabsTrigger value="advanced">Advanced</TabsTrigger>
  </TabsList>
  <TabsContent value="settings">
    {/* Basic settings */}
    <div className="space-y-4">
      <div className="grid gap-2">
        <Label htmlFor="brush-size">Brush Size</Label>
        <Slider 
          id="brush-size" 
          min={5} 
          max={100} 
          step={1} 
          value={[brushSize]} 
          onValueChange={values => setBrushSize(values[0])} 
        />
      </div>
      <div className="grid gap-2">
        <Label htmlFor="creativity">Creativity</Label>
        <Slider 
          id="creativity" 
          min={0.1} 
          max={1} 
          step={0.01} 
          value={[creativity]} 
          onValueChange={values => setCreativity(values[0])} 
        />
      </div>
      <div className="grid gap-2">
        <Label htmlFor="custom-prompt">Custom Prompt</Label>
        <Textarea 
          id="custom-prompt" 
          placeholder={t('inpaint.customPromptPlaceholder')} 
          value={customPrompt} 
          onChange={e => setCustomPrompt(e.target.value)} 
          rows={3} 
        />
      </div>
    </div>
  </TabsContent>
  <TabsContent value="advanced">
    {/* Advanced LoRA settings */}
  </TabsContent>
</Tabs>

Viewing and Managing Inpainted Images

After inpainting, the new inpainted version will be saved alongside the original.

Comparing Versions

You can easily compare the original and inpainted versions:

  1. In the image preview panel, you’ll see buttons for “Original” and “Inpainted”
  2. Click on “Inpainted” to view your modified version
  3. Click “Compare” to see a side-by-side comparison with a slider

Multiple Inpainted Versions

You can create multiple inpainted versions of the same image:

  1. Each version is saved separately
  2. Use the version selector in the inpainted tab to switch between versions
  3. The most recent version is selected by default

Inpainting and Upscaling Workflow

You can combine inpainting and upscaling in a sequence to achieve the best results:

Workflow 1: Inpaint → Upscale

  1. Inpaint an original image to modify specific areas
  2. Upscale the inpainted version to improve resolution
  3. The result will be labeled as “Upscaled Inpaint”

Workflow 2: Original → Different Inpaints

  1. Create multiple inpainted versions with different modifications
  2. Compare the variations to choose the best one
  3. Optionally upscale your favorite version

Limitations and Considerations

  • Area Selection: Be precise with your brush selection. The AI works best when the selection has clear boundaries.
  • Context Awareness: The AI considers the surrounding areas to generate contextually appropriate inpainting.
  • Processing Time: Inpainting may take longer for complex areas or larger selections.
  • Content Policies: All generated content must adhere to our content policies.

Troubleshooting

Common Issues and Solutions

Issue: Inpainting button is disabled Solution: Verify you’re viewing an original or inpainted image, not an upscaled one

Issue: Inpainting doesn’t match the style of the image Solution: Try using a custom prompt that describes the desired style, or reduce the creativity value

Issue: Poor boundaries between inpainted and original areas Solution: Use a smaller brush size for more precise selection around boundaries

Best Practices

  1. Make focused edits: Target specific areas rather than large portions
  2. Use appropriate brush size: Match your brush size to the detail level you’re editing
  3. Experiment with creativity: Lower values maintain consistency, higher values allow more variation
  4. Guide with prompts: Use specific prompts for predictable results
  5. Consider multiple versions: Create several variations before upscaling

If you have any questions or need further assistance with the inpainting feature, please contact our support team.