{"course":{"slug":"ai-images","title":"Image Generation, in Practice","url":"https://addaly.com/learn/ai-images","level":"beginner","track":"create"},"lesson":{"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","position":43,"of":69,"minutes":8,"answer":"Repair has a correct order (structure, then faces and hands, then edges, then small objects, then grade and grain last) because each stage changes the pixels the next stage would otherwise have worked on.","keyIdea":"Repair has a correct order (structure, then faces and hands, then edges, then small objects, then grade and grain last) because each stage changes the pixels the next stage would otherwise have worked on."},"body":{"format":"markdown","text":"## Why order matters at all\n\nMost people repair in the order they notice things. They see a bad hand, fix it. Then they notice the background doorway is geometrically impossible, fix that, and the fix changes the light on the arm, so the hand needs doing again. Then they grade the image, and the graded version reveals a seam around the hand that was invisible before.\n\nEvery one of those is a repeat of work already done. An order exists that prevents it, and it comes from one principle: **fix the things that change the most pixels first.**\n\n## The order\n\n**1. Structure.** Anything that is geometrically wrong across a large area: a wall that does not meet the floor, a table with an impossible edge, a limb emerging from the wrong place. These need large masks and a high denoise, so they overwrite everything nearby.\n\n**2. Large removals and additions.** Taking out an object, adding one. Same reason: large area, large change.\n\n**3. Faces and hands.** The expensive, attention-demanding work. It comes after structure because a structural fix next to a face will disturb it.\n\n**4. Edges and boundaries.** Where two things meet: hair against background, a product against a surface, a sleeve against an arm. These are small masks at moderate denoise.\n\n**5. Small objects and details.** Jewellery, buttons, cutlery, the stems of glasses, wristwatches.\n\n**6. Global grade and grain.** Contrast, colour, vignette, grain, sharpening. Always last, and always on a flattened copy, because grain applied before a repair means the repaired patch has no grain and shows.\n\n> Figure: The order that stops you doing the same repair twice. Timeline: First, Structure. Anything geometrically wrong across a large area: a wall that does not meet the floor, a limb from the wrong place. Large masks, high denoise.; Second, Large removals and additions. Same reason: large area, large change, everything nearby overwritten.; Third, Faces and hands. The attention-demanding work, after structure, because a structural fix beside a face disturbs it.; Fourth, Edges and boundaries. Hair against background, a product against a surface. Small masks, moderate denoise.; Fifth, Small objects and details. Jewellery, buttons, cutlery, the stems of glasses.; Last, Global grade and grain, on a flattened copy. Grain applied before a repair leaves the repaired patch with none, and it shows.. The principle underneath is one line: fix the things that change the most pixels first. Every repair done out of order is a repeat of work already done.\n\n## The estimate, written down\n\nBefore starting, list the faults with minutes against each: the keeper checklist ended with this and it matters more here.\n\n```text\nseed 418, base render\n  1 doorway geometry, upper right      structure    8\n  2 remove stray object on table       removal      4\n  3 both hands                         hands       14\n  4 face, slight asymmetry at 3/4      face         6\n  5 bangle merging into wrist          edge         4\n  6 chilli stems, foreground           detail       5\n  7 grade, grain                       global       6\n                                                   47\n```\n\nForty-seven minutes is a normal figure for a hero image and a useful one to know, because it is what you are quoting for. If the list exceeds ninety minutes, go back to the contact sheet: a better base render is a minute away and will cost half as much to finish.\n\n## Working non-destructively\n\nEvery repair happens on a copy. The practical arrangement:\n\n```text\ngen/v01/00418-base.png          never touched\nwork/hero.xcf                   layered file, repairs as layers\ndeliver/hero-v03.jpg            flattened output\n```\n\nIn GIMP, Krita or Photopea, each inpainted region comes back as its own layer with a mask. That way a repair you later dislike is one layer to delete, rather than a reason to start again. It also means that when the client asks on Thursday whether the earlier hand was better, you can show them in four seconds.\n\nThe habit that costs people whole afternoons is inpainting in the generator, saving over the file, inpainting again, saving over it. Six passes later something is wrong and there is no way back to pass three.\n\n## Two failures specific to repair\n\n**The patch that does not belong.** An inpainted region regenerated at full resolution often comes back sharper, more contrasty and slightly differently coloured than its surroundings, because it was denoised with a different amount of context. It looks pasted. The fix is a low-denoise pass over the *joint* afterwards: mask a ring around the repaired area at 0.25 and let the model reconcile it.\n\n**Drift across many repairs.** Twelve inpainting passes each shift the local colour slightly, and after twelve the image has a subtly uneven quality that no single region explains. This is why the grade goes last: a single global correction over an image with accumulated local drift fixes far less than people expect. Keep the number of passes down, use larger masks rather than many small ones, and check the whole image at 50% every few repairs rather than staying zoomed in.\n\n## When to stop\n\nThere is a point where repair stops improving the picture and starts sanding it flat. The signal is that you are fixing things nobody would notice: a slightly odd fold in fabric, an unconvincing reflection in a background window at 400% zoom.\n\nView at 100% and at the delivered size. If a fault is invisible at both, it is not a fault. Clients do not zoom to 400%, and an image that has been repaired into perfect smoothness has usually lost the incidental irregularity that made it look like a photograph in the first place."},"check":{"question":"Why must global grain and grading be applied after all masked repairs rather than before?","options":[{"text":"Because grading before repair shifts the colours the inpainting model matches against, so every repaired patch inherits the wrong base tone.","correct":false,"tempting":"Plausible, but inpainting matches the surrounding pixels whatever their tone, so a graded image gives a correctly matched patch; the problem is texture, not colour."},{"text":"Because a repaired region regenerates without the grain that was applied earlier, so the patch shows as a smooth area.","correct":true},{"text":"Because grading is destructive and cannot be undone once the file has been flattened for the inpainting pass to run on it.","correct":false,"tempting":"Describes poor file discipline rather than the reason for the order; a layered workflow makes grading non-destructive either way."},{"text":"Because the inpainting model is trained on ungraded images and performs measurably worse when given a strongly graded region to complete.","correct":false,"tempting":"Training data covers heavily graded photographs throughout, and inpainting quality does not depend on whether a curve has been applied."}]},"prev":{"slug":"inpainting-is-the-job","title":"The finished image is never one generation","url":"https://addaly.com/learn/ai-images/inpainting-is-the-job"},"next":{"slug":"hands-eyes-teeth","title":"The three repairs everybody needs, with settings","url":"https://addaly.com/learn/ai-images/hands-eyes-teeth"},"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) 'Fix it in the order that stops you doing it twice', in Image Generation, in Practice. Edited by M. Mun. Addaly. Available at: https://addaly.com/learn/ai-images/the-repair-triage (Accessed: 13 October 2026).","licence":{"name":"CC BY-NC-SA 4.0","url":"https://creativecommons.org/licenses/by-nc-sa/4.0/"},"reader":{"schema":1,"title":"Fix it in the order that stops you doing it twice","courseTitle":"Image Generation, in Practice","module":{"index":5,"slug":"repair-and-extend","title":"Repair, extend, assemble"},"answer":null,"keyIdea":"Repair has a correct order (structure, then faces and hands, then edges, then small objects, then grade and grain last) because each stage changes the pixels the next stage would otherwise have worked on.","hero":{"kind":"figure","figure":{"t":"figure","label":"Figure","figure":{"type":"timeline","title":"The order that stops you doing the same repair twice","events":[{"when":"First","what":"Structure. Anything geometrically wrong across a large area: a wall that does not meet the floor, a limb from the wrong place. Large masks, high denoise."},{"when":"Second","what":"Large removals and additions. Same reason: large area, large change, everything nearby overwritten."},{"when":"Third","what":"Faces and hands. The attention-demanding work, after structure, because a structural fix beside a face disturbs it."},{"when":"Fourth","what":"Edges and boundaries. Hair against background, a product against a surface. Small masks, moderate denoise."},{"when":"Fifth","what":"Small objects and details. Jewellery, buttons, cutlery, the stems of glasses."},{"when":"Last","what":"Global grade and grain, on a flattened copy. Grain applied before a repair leaves the repaired patch with none, and it shows."}],"caption":"The principle underneath is one line: fix the things that change the most pixels first. Every repair done out of order is a repeat of work already done."},"alt":"Figure: The order that stops you doing the same repair twice. Timeline: First, Structure. Anything geometrically wrong across a large area: a wall that does not meet the floor, a limb from the wrong place. Large masks, high denoise.; Second, Large removals and additions. Same reason: large area, large change, everything nearby overwritten.; Third, Faces and hands. The attention-demanding work, after structure, because a structural fix beside a face disturbs it.; Fourth, Edges and boundaries. Hair against background, a product against a surface. Small masks, moderate denoise.; Fifth, Small objects and details. Jewellery, buttons, cutlery, the stems of glasses.; Last, Global grade and grain, on a flattened copy. Grain applied before a repair leaves the repaired patch with none, and it shows.. The principle underneath is one line: fix the things that change the most pixels first. Every repair done out of order is a repeat of work already done."}},"blocks":[{"t":"h2","id":"why-order-matters-at-all","runs":[{"text":"Why order matters at all"}]},{"t":"p","runs":[{"text":"Most people repair in the order they notice things. They see a bad hand, fix it. Then they notice the background doorway is geometrically impossible, fix that, and the fix changes the light on the arm, so the hand needs doing again. Then they grade the image, and the graded version reveals a seam around the hand that was invisible before."}]},{"t":"p","runs":[{"text":"Every one of those is a repeat of work already done. An order exists that prevents it, and it comes from one principle: "},{"text":"fix the things that change the most pixels first.","b":true}]},{"t":"h2","id":"the-order","runs":[{"text":"The order"}]},{"t":"p","runs":[{"text":"1. Structure.","b":true},{"text":" Anything that is geometrically wrong across a large area: a wall that does not meet the floor, a table with an impossible edge, a limb emerging from the wrong place. These need large masks and a high denoise, so they overwrite everything nearby."}]},{"t":"p","runs":[{"text":"2. Large removals and additions.","b":true},{"text":" Taking out an object, adding one. Same reason: large area, large change."}]},{"t":"p","runs":[{"text":"3. Faces and hands.","b":true},{"text":" The expensive, attention-demanding work. It comes after structure because a structural fix next to a face will disturb it."}]},{"t":"p","runs":[{"text":"4. Edges and boundaries.","b":true},{"text":" Where two things meet: hair against background, a product against a surface, a sleeve against an arm. These are small masks at moderate denoise."}]},{"t":"p","runs":[{"text":"5. Small objects and details.","b":true},{"text":" Jewellery, buttons, cutlery, the stems of glasses, wristwatches."}]},{"t":"p","runs":[{"text":"6. Global grade and grain.","b":true},{"text":" Contrast, colour, vignette, grain, sharpening. Always last, and always on a flattened copy, because grain applied before a repair means the repaired patch has no grain and shows."}]},{"t":"h2","id":"the-estimate-written-down","runs":[{"text":"The estimate, written down"}]},{"t":"p","runs":[{"text":"Before starting, list the faults with minutes against each: the keeper checklist ended with this and it matters more here."}]},{"t":"code","lang":"text","label":"Text","text":"seed 418, base render\n  1 doorway geometry, upper right      structure    8\n  2 remove stray object on table       removal      4\n  3 both hands                         hands       14\n  4 face, slight asymmetry at 3/4      face         6\n  5 bangle merging into wrist          edge         4\n  6 chilli stems, foreground           detail       5\n  7 grade, grain                       global       6\n                                                   47"},{"t":"p","runs":[{"text":"Forty-seven minutes is a normal figure for a hero image and a useful one to know, because it is what you are quoting for. If the list exceeds ninety minutes, go back to the contact sheet: a better base render is a minute away and will cost half as much to finish."}]},{"t":"h2","id":"working-non-destructively","runs":[{"text":"Working non-destructively"}]},{"t":"p","runs":[{"text":"Every repair happens on a copy. The practical arrangement:"}]},{"t":"code","lang":"text","label":"Text","text":"gen/v01/00418-base.png          never touched\nwork/hero.xcf                   layered file, repairs as layers\ndeliver/hero-v03.jpg            flattened output"},{"t":"p","runs":[{"text":"In GIMP, Krita or Photopea, each inpainted region comes back as its own layer with a mask. That way a repair you later dislike is one layer to delete, rather than a reason to start again. It also means that when the client asks on Thursday whether the earlier hand was better, you can show them in four seconds."}]},{"t":"p","runs":[{"text":"The habit that costs people whole afternoons is inpainting in the generator, saving over the file, inpainting again, saving over it. Six passes later something is wrong and there is no way back to pass three."}]},{"t":"h2","id":"two-failures-specific-to-repair","runs":[{"text":"Two failures specific to repair"}]},{"t":"p","runs":[{"text":"The patch that does not belong.","b":true},{"text":" An inpainted region regenerated at full resolution often comes back sharper, more contrasty and slightly differently coloured than its surroundings, because it was denoised with a different amount of context. It looks pasted. The fix is a low-denoise pass over the "},{"text":"joint","i":true},{"text":" afterwards: mask a ring around the repaired area at 0.25 and let the model reconcile it."}]},{"t":"p","runs":[{"text":"Drift across many repairs.","b":true},{"text":" Twelve inpainting passes each shift the local colour slightly, and after twelve the image has a subtly uneven quality that no single region explains. This is why the grade goes last: a single global correction over an image with accumulated local drift fixes far less than people expect. Keep the number of passes down, use larger masks rather than many small ones, and check the whole image at 50% every few repairs rather than staying zoomed in."}]},{"t":"h2","id":"when-to-stop","runs":[{"text":"When to stop"}]},{"t":"p","runs":[{"text":"There is a point where repair stops improving the picture and starts sanding it flat. The signal is that you are fixing things nobody would notice: a slightly odd fold in fabric, an unconvincing reflection in a background window at 400% zoom."}]},{"t":"p","runs":[{"text":"View at 100% and at the delivered size. If a fault is invisible at both, it is not a fault. Clients do not zoom to 400%, and an image that has been repaired into perfect smoothness has usually lost the incidental irregularity that made it look like a photograph in the first place."}]}],"check":{"question":[{"text":"Why must global grain and grading be applied after all masked repairs rather than before?"}],"options":[{"text":[{"text":"Because grading before repair shifts the colours the inpainting model matches against, so every repaired patch inherits the wrong base tone."}],"correct":false,"tempting":[{"text":"Plausible, but inpainting matches the surrounding pixels whatever their tone, so a graded image gives a correctly matched patch; the problem is texture, not colour."}]},{"text":[{"text":"Because a repaired region regenerates without the grain that was applied earlier, so the patch shows as a smooth area."}],"correct":true,"tempting":null},{"text":[{"text":"Because grading is destructive and cannot be undone once the file has been flattened for the inpainting pass to run on it."}],"correct":false,"tempting":[{"text":"Describes poor file discipline rather than the reason for the order; a layered workflow makes grading non-destructive either way."}]},{"text":[{"text":"Because the inpainting model is trained on ungraded images and performs measurably worse when given a strongly graded region to complete."}],"correct":false,"tempting":[{"text":"Training data covers heavily graded photographs throughout, and inpainting quality does not depend on whether a curve has been applied."}]}],"order":[2,1,3,0],"why":null},"prev":{"slug":"inpainting-is-the-job","title":"The finished image is never one generation","minutes":9},"next":{"slug":"hands-eyes-teeth","title":"The three repairs everybody needs, with settings","minutes":8}}}