Iteration and "Inpainting": Correcting and Refining Images
Reading time: approximately 7 minutes
Rarely does an AI-generated image become perfect on the first try. Mastering AI image creation is as much about being able to refine and correct as it is about writing the first prompt. In this moment, you learn the two main methods for adjusting your images: iterating your prompt and using editing tools like "Inpainting".
What You Will Learn
- How to systematically improve a prompt (iteration).
- What "Inpainting" (patching) and "Outpainting" (extending) are and how they are used.
- Strategies for solving common problems, like incorrect details or unwanted objects.
The Basics: No Image is Perfect from the Start
See your first generated image as a draft, not a final product. When the result does not match your vision, you have two paths to take:
- Iterative Prompting: You adjust your original text prompt and generate a completely new image. This is best when the overall composition or style is wrong.
- Image Editing (Inpainting): You keep the parts of the image you like and let the AI only redraw a specific, marked area. This is perfect for correcting small errors.
Practical Examples: Iterative Prompting
To iterate is to make small, deliberate changes in the prompt to approach the goal step by step.
Scenario: You want an image of a researcher in a lab.
First attempt:
A researcher in a lab.Result: A fairly generic image, perhaps with a messy lab.
Iteration 1 (Specify subject and environment):
An **experienced female chemist with safety goggles** in a **clean and modern** laboratory.Result: Better, but you want to adjust the mood.
Iteration 2 (Add style and light):
An experienced female chemist with safety goggles in a clean and modern laboratory, **illuminated by soft window light, photorealistic style.**Result: Now you have an image that is much closer to a specific vision, all by building on the prompt step by step.
Practical Examples: Image Editing with "Inpainting"
Inpainting is like a magic eraser combined with a brush. You mark an area in the image you want to change and then describe with a new, short prompt what the AI should draw there instead.
Scenario 1: Correct a Common Error
You have generated an otherwise perfect image of a historical person, but the AI has created a hand with six fingers (a notoriously common AI problem).
- Process: Use the Inpainting tool in your AI service and mark the area with the incorrect hand.
- Inpainting prompt:
a human hand with five fingers resting on an armrest - Result: The AI redraws only the marked area and replaces the incorrect hand with a new, hopefully correct, hand that fits into the rest of the image.
Scenario 2: Add an Object
You have an image of a landscape but want to place a building in it.
- Process: Mark an area on a meadow in your image.
- Inpainting prompt:
a small red cottage with white corners - Result: The AI draws the cottage in the marked area and automatically adjusts light and shadows to the surrounding image.
Bonus: "Outpainting" (Extending)
Outpainting is the opposite of Inpainting. Instead of changing something in the image, you expand the image area. You make the canvas larger, and the AI fills in the new, empty areas based on what already exists in the image. This is an excellent tool for, for example, converting a portrait image into a landscape image.
Next Steps
You now have the technical skills to create and refine images. But with great power comes great responsibility. In the next critical moment, "Ethics, Copyright and Source Criticism", we discuss the important rules and approaches around AI image creation.

