{"course":{"slug":"ai-images","title":"Image Generation, in Practice","url":"https://addaly.com/learn/ai-images","level":"beginner","track":"create"},"lesson":{"slug":"inpainting-is-the-job","title":"The finished image is never one generation","url":"https://addaly.com/learn/ai-images/inpainting-is-the-job","position":42,"of":69,"minutes":9,"answer":"Generate a base plate, then repair it region by region; the \"inpaint at full resolution\" setting is what gives a small detail enough pixels to be drawn correctly.","keyIdea":"Generate a base plate, then repair it region by region; the \"inpaint at full resolution\" setting is what gives a small detail enough pixels to be drawn correctly."},"body":{"format":"markdown","text":"## The gap between a good image and a usable one\n\nThe image is right. The expression is right, the light is right, the client will like it. And there are six fingers on the left hand, the shop sign says CAFFEE, and there is a stray object floating near the shoulder.\n\nBeginners regenerate. They roll the dice again, lose the good expression, get worse hands, and spend an afternoon and a month's credits chasing a single perfect roll. Working illustrators do not do this. They accept the frame as a base plate and repair it.\n\nInpainting is that repair, and it is where most of the real work in this craft happens.\n\n## How inpainting works, and the one setting that matters\n\nYou paint a mask over a region. The model regenerates only inside the mask, conditioned on everything outside it, so the new pixels match the surrounding light and colour.\n\nNow the setting that separates people who can fix hands from people who cannot. Look for a control called **\"inpaint at full resolution\"**, **\"only masked\"**, or **\"crop to mask\"**.\n\nWith it off, the model regenerates your masked region at the whole image's scale. If your picture is 1024 pixels wide and the hand occupies 80 of them, the model gets 80 pixels of budget to draw a hand. It cannot. It produces the same mush every time, and you conclude the model is bad at hands.\n\nWith it on, the tool crops to the masked area plus some padding, regenerates *that crop* at the model's full working resolution (so the hand gets 800 pixels of attention instead of 80) and scales the result back in. The same model that could not draw a hand now draws it correctly, because the problem was never the model. It was the pixel budget.\n\n> Figure: The pixel budget a hand gets, with one setting off and on. Bars (pixels across, for the model to draw the hand): Inpainting at the whole image's scale 80; Inpainting at full resolution, only masked 800. The same model that could not draw a hand now draws it correctly, because the problem was never the model. It was eighty pixels of budget for a structure with twenty-seven bones in it.\n\nThat single toggle fixes more images than any prompt technique in existence.\n\n## The other three controls\n\n**Mask blur / feather.** A hard mask edge leaves a visible seam. A few pixels of blur lets the new region fade into the old. Too much blur and the model starts blending the thing you were trying to remove back in.\n\n**Padding.** How much surrounding context the crop includes. Too little and the model cannot see the arm the hand belongs to, so it draws a hand pointing the wrong way. Too much and you are back to a small pixel budget.\n\n**Denoise strength**, again. For a repair, 0.6-0.8: you want it to actually replace what is there. For a subtle correction, 0.3.\n\n## Outpainting, and the thing clients always ask for\n\nOutpainting extends the canvas: the model invents new image beyond the existing edges, matched to what is there.\n\nThe everyday use is not artistic. You made a beautiful 16:9 frame and the client needs 9:16 for Stories and 1:1 for the feed. Cropping destroys the composition. Outpainting builds the missing top and bottom, and then you crop from a larger canvas.\n\nPhotoshop calls this Generative Expand. Free equivalents that do the same job: **Krita with AI Diffusion**, **InvokeAI's canvas**, **ComfyUI** with an outpaint node, and most hosted tools have an expand or uncrop button.\n\n## The failure modes, with their causes\n\n**Colour drift.** Inpaint the same area eight times and the region slowly diverges in colour and contrast from the rest, because each pass is a fresh generation matched only approximately to its surroundings. Fix it outside the model: flatten, then a curves and colour-balance pass on that region in a raster editor. Do not try to inpaint your way back to matching.\n\n**Halo edges.** Almost always too little padding or a mask drawn tight to the object's silhouette. Mask generously: include some of the background around what you are replacing.\n\n**The model ignores your mask.** Some tools mask the *latent* rather than the pixels, which means the edges bleed. If a tool consistently modifies outside your mask, it is that, and switching tools is faster than fighting it.\n\n## The workflow this implies\n\n1. Generate cheaply until you have a base plate with the right composition and mood. Stop there. Do not chase perfection.\n2. Inpaint each defect separately, at full resolution, one at a time.\n3. Flatten and do a colour and contrast pass in an editor.\n4. Only then upscale.\n\nThat order matters and lesson seven explains why the last step is last.\n\nToday: take any generated image you have with a flaw in it, open a free inpainting tool, mask the flaw, and confirm you have found the \"only masked\" setting before you press generate. If the tool does not have one, that tells you something about the tool."},"check":{"question":"Someone repeatedly inpaints a mangled hand in a 1024-pixel-wide image and it stays mangled, even though the same model draws perfect hands when asked for a close-up of a hand. What is the most likely cause?","options":[{"text":"The model is genuinely weak at hands and only a hand-specific LoRA will fix it.","correct":false,"tempting":"Reaches for a model-level fix for a problem caused by how the region was rendered."},{"text":"The mask is feathered too heavily, so the original hand is being blended back into the new one.","correct":false,"tempting":"Names a real setting, but feathering affects the seam at the mask edge, not how much detail the region can hold."},{"text":"The prompt does not describe the hand's position, so the model has nothing to work from.","correct":false,"tempting":"Assumes description can compensate when the constraint is the number of pixels available."},{"text":"Without \"only masked\" or \"inpaint at full resolution\" enabled, the region is regenerated at the whole image's scale, so the hand gets a few dozen pixels of budget and there is no room for the detail.","correct":true}]},"prev":{"slug":"stacking-controls","title":"Two controls, without the plastic look","url":"https://addaly.com/learn/ai-images/stacking-controls"},"next":{"slug":"the-repair-triage","title":"Fix it in the order that stops you doing it twice","url":"https://addaly.com/learn/ai-images/the-repair-triage"},"authorship":"Founder and series editor: Dr Mustafa Mun. Written by AI models to a written standard. Exam keys checked blind by a second model: 3,665 of 3,666 agreed. Academic review invited.","review":{"status":"Draft, open for academic review"},"cite":"Addaly (2026) 'The finished image is never one generation', in Image Generation, in Practice. Edited by M. Mun. Addaly. Available at: https://addaly.com/learn/ai-images/inpainting-is-the-job (Accessed: 31 October 2026).","licence":{"name":"CC BY-NC-SA 4.0","url":"https://creativecommons.org/licenses/by-nc-sa/4.0/"},"reader":{"schema":1,"title":"The finished image is never one generation","courseTitle":"Image Generation, in Practice","module":{"index":5,"slug":"repair-and-extend","title":"Repair, extend, assemble"},"answer":null,"keyIdea":"Generate a base plate, then repair it region by region; the “inpaint at full resolution” setting is what gives a small detail enough pixels to be drawn correctly.","hero":{"kind":"figure","figure":{"t":"figure","label":"Figure 5.1","figure":{"type":"bars","unit":"pixels across, for the model to draw the hand","title":"The pixel budget a hand gets, with one setting off and on","series":[{"label":"Inpainting at the whole image’s scale","value":80},{"label":"Inpainting at full resolution, only masked","value":800,"highlight":true}],"caption":"The same model that could not draw a hand now draws it correctly, because the problem was never the model. It was eighty pixels of budget for a structure with twenty-seven bones in it."},"alt":"Figure: The pixel budget a hand gets, with one setting off and on. Bars (pixels across, for the model to draw the hand): Inpainting at the whole image’s scale 80; Inpainting at full resolution, only masked 800. The same model that could not draw a hand now draws it correctly, because the problem was never the model. It was eighty pixels of budget for a structure with twenty-seven bones in it."}},"blocks":[{"t":"h2","id":"the-gap-between-a-good-image-and-a-usable-one","runs":[{"text":"The gap between a good image and a usable one"}]},{"t":"p","runs":[{"text":"The image is right. The expression is right, the light is right, the client will like it. And there are six fingers on the left hand, the shop sign says CAFFEE, and there is a stray object floating near the shoulder."}]},{"t":"p","runs":[{"text":"Beginners regenerate. They roll the dice again, lose the good expression, get worse hands, and spend an afternoon and a month’s credits chasing a single perfect roll. Working illustrators do not do this. They accept the frame as a base plate and repair it."}]},{"t":"p","runs":[{"text":"Inpainting is that repair, and it is where most of the real work in this craft happens."}]},{"t":"h2","id":"how-inpainting-works-and-the-one-setting-that-matters","runs":[{"text":"How inpainting works, and the one setting that matters"}]},{"t":"p","runs":[{"text":"You paint a mask over a region. The model regenerates only inside the mask, conditioned on everything outside it, so the new pixels match the surrounding light and colour."}]},{"t":"p","runs":[{"text":"Now the setting that separates people who can fix hands from people who cannot. Look for a control called "},{"text":"”inpaint at full resolution”","b":true},{"text":", "},{"text":"”only masked”","b":true},{"text":", or "},{"text":"”crop to mask”","b":true},{"text":"."}]},{"t":"p","runs":[{"text":"With it off, the model regenerates your masked region at the whole image’s scale. If your picture is 1024 pixels wide and the hand occupies 80 of them, the model gets 80 pixels of budget to draw a hand. It cannot. It produces the same mush every time, and you conclude the model is bad at hands."}]},{"t":"p","runs":[{"text":"With it on, the tool crops to the masked area plus some padding, regenerates "},{"text":"that crop","i":true},{"text":" at the model’s full working resolution (so the hand gets 800 pixels of attention instead of 80) and scales the result back in. The same model that could not draw a hand now draws it correctly, because the problem was never the model. It was the pixel budget."}]},{"t":"p","runs":[{"text":"That single toggle fixes more images than any prompt technique in existence."}]},{"t":"h2","id":"the-other-three-controls","runs":[{"text":"The other three controls"}]},{"t":"p","runs":[{"text":"Mask blur / feather.","b":true},{"text":" A hard mask edge leaves a visible seam. A few pixels of blur lets the new region fade into the old. Too much blur and the model starts blending the thing you were trying to remove back in."}]},{"t":"p","runs":[{"text":"Padding.","b":true},{"text":" How much surrounding context the crop includes. Too little and the model cannot see the arm the hand belongs to, so it draws a hand pointing the wrong way. Too much and you are back to a small pixel budget."}]},{"t":"p","runs":[{"text":"Denoise strength","b":true},{"text":", again. For a repair, 0.6-0.8: you want it to actually replace what is there. For a subtle correction, 0.3."}]},{"t":"h2","id":"outpainting-and-the-thing-clients-always-ask-for","runs":[{"text":"Outpainting, and the thing clients always ask for"}]},{"t":"p","runs":[{"text":"Outpainting extends the canvas: the model invents new image beyond the existing edges, matched to what is there."}]},{"t":"p","runs":[{"text":"The everyday use is not artistic. You made a beautiful 16:9 frame and the client needs 9:16 for Stories and 1:1 for the feed. Cropping destroys the composition. Outpainting builds the missing top and bottom, and then you crop from a larger canvas."}]},{"t":"p","runs":[{"text":"Photoshop calls this Generative Expand. Free equivalents that do the same job: "},{"text":"Krita with AI Diffusion","b":true},{"text":", "},{"text":"InvokeAI’s canvas","b":true},{"text":", "},{"text":"ComfyUI","b":true},{"text":" with an outpaint node, and most hosted tools have an expand or uncrop button."}]},{"t":"h2","id":"the-failure-modes-with-their-causes","runs":[{"text":"The failure modes, with their causes"}]},{"t":"p","runs":[{"text":"Colour drift.","b":true},{"text":" Inpaint the same area eight times and the region slowly diverges in colour and contrast from the rest, because each pass is a fresh generation matched only approximately to its surroundings. Fix it outside the model: flatten, then a curves and colour-balance pass on that region in a raster editor. Do not try to inpaint your way back to matching."}]},{"t":"p","runs":[{"text":"Halo edges.","b":true},{"text":" Almost always too little padding or a mask drawn tight to the object’s silhouette. Mask generously: include some of the background around what you are replacing."}]},{"t":"p","runs":[{"text":"The model ignores your mask.","b":true},{"text":" Some tools mask the "},{"text":"latent","i":true},{"text":" rather than the pixels, which means the edges bleed. If a tool consistently modifies outside your mask, it is that, and switching tools is faster than fighting it."}]},{"t":"h2","id":"the-workflow-this-implies","runs":[{"text":"The workflow this implies"}]},{"t":"ol","start":1,"items":[[{"text":"Generate cheaply until you have a base plate with the right composition and mood. Stop there. Do not chase perfection."}],[{"text":"Inpaint each defect separately, at full resolution, one at a time."}],[{"text":"Flatten and do a colour and contrast pass in an editor."}],[{"text":"Only then upscale."}]]},{"t":"p","runs":[{"text":"That order matters and lesson seven explains why the last step is last."}]},{"t":"p","runs":[{"text":"Today: take any generated image you have with a flaw in it, open a free inpainting tool, mask the flaw, and confirm you have found the “only masked” setting before you press generate. If the tool does not have one, that tells you something about the tool."}]}],"check":{"question":[{"text":"Someone repeatedly inpaints a mangled hand in a 1024-pixel-wide image and it stays mangled, even though the same model draws perfect hands when asked for a close-up of a hand. What is the most likely cause?"}],"options":[{"text":[{"text":"The model is genuinely weak at hands and only a hand-specific LoRA will fix it."}],"correct":false,"tempting":[{"text":"Reaches for a model-level fix for a problem caused by how the region was rendered."}]},{"text":[{"text":"The mask is feathered too heavily, so the original hand is being blended back into the new one."}],"correct":false,"tempting":[{"text":"Names a real setting, but feathering affects the seam at the mask edge, not how much detail the region can hold."}]},{"text":[{"text":"The prompt does not describe the hand’s position, so the model has nothing to work from."}],"correct":false,"tempting":[{"text":"Assumes description can compensate when the constraint is the number of pixels available."}]},{"text":[{"text":"Without “only masked” or “inpaint at full resolution” enabled, the region is regenerated at the whole image’s scale, so the hand gets a few dozen pixels of budget and there is no room for the detail."}],"correct":true,"tempting":null}],"order":[0,3,1,2],"why":null},"prev":{"slug":"stacking-controls","title":"Two controls, without the plastic look","minutes":8},"next":{"slug":"the-repair-triage","title":"Fix it in the order that stops you doing it twice","minutes":8}}}