Sub topic 9
Refining results with masks, adjustments, and iteration
Generative Fill and Generative Expand rarely give a finished image on the first pass. This chapter covers the working model for refining output: fix the edges with the layer mask, match the tone and color with adjustment layers, and repeat generation on smaller areas until the result holds up at 100% zoom.
This chapter assumes you can make selections, understand layers and layer masks, and know how to find the generative layer's Properties panel. It does not repeat how to run Generative Fill or write prompts.
The refinement model
A generative layer is a pixel layer with a layer mask, and it keeps its prompt and variations in the Properties panel. The mask records where the generated pixels show through. That gives you three independent places to fix a problem:
| Problem | Where to fix it | Tool |
|---|---|---|
| Visible seam or halo at the selection edge | The layer's mask | Brush, Gradient, Select and Mask |
| Wrong brightness, contrast, or color cast | A clipped adjustment layer | Curves, Levels, Color Balance |
| Wrong content, odd detail, or artifacts | A new generation on a smaller selection | Generative Fill |
| Grain or sharpness that differs from the photo | A separate texture or noise layer | Add Noise, Smart Filters |
Fix problems in this order: content first, then edges, then tone. Adjusting color on content you will regenerate wastes work.
Refining edges with the layer mask
Photoshop generates pixels for the selection and also a margin around it, then blends them using the mask. The mask is not a hard copy of your selection. Look at it before changing anything.
- Select the generative layer.
- Hold Alt (Windows) or Option (Mac) and click the mask thumbnail to view the mask alone.
- Look for a hard, binary edge, or for a gray region that extends well beyond your selection.
Common mask fixes:
- Hard edge or visible halo. Paint on the mask with a soft black brush at low opacity (10 to 20 percent) along the boundary. Several light passes blend better than one heavy stroke.
- Generated content spills into an area you wanted left alone. Paint black on the mask there. The generated pixels are hidden, not deleted, so you can paint white to bring them back.
- Part of the result is missing. Paint white on the mask. This only reveals pixels that already exist on the layer. If the pixels were never generated, you need to regenerate.
- Edge of a rigid subject, such as a building or product. Open Select and Mask from the Properties panel and use a small Feather value or the Refine Edge Brush on the mask.
Using a gradient for lighting transitions
When generated content must fade into the original, such as sky extended with Generative Expand, a gradient on the mask is often cleaner than a brush. Select the Gradient tool, choose the Foreground to Transparent preset, and drag across the seam while the mask is active. The fade follows the direction of the light change instead of the shape of your original selection.
Matching tone and color with adjustment layers
Generated pixels often have slightly different contrast, saturation, or white balance than the photo around them. Do not adjust the original photo to fix this. Apply the correction to the generative layer only by clipping an adjustment layer to it.
- Click the generative layer.
- Add an adjustment layer, for example Curves, from the bottom of the Layers panel.
- Right-click the new adjustment layer and choose Create Clipping Mask. Or hold Alt/Option and click the line between the two layers.
- Adjust until the generated area matches its surroundings.
A clipped adjustment affects only the visible pixels of the layer below it, so it respects your mask edits. If you later hide or delete the generative layer, the adjustment goes with it.
Which adjustment to use depends on the mismatch:
| Mismatch | Adjustment |
|---|---|
| Too bright or too dark overall | Levels or Exposure |
| Flat contrast | Curves with a mild S-curve |
| Color cast, for example too warm | Color Balance or Photo Filter |
| Too saturated | Hue/Saturation or Vibrance |
| Shadows too dense or too faint | Curves, anchoring the midpoint |
A quick way to judge a match is to zoom out to fit the screen, then toggle the generative layer's visibility. A good result does not draw the eye when the layer is switched back on.
Matching grain and sharpness
Photographs have noise and a specific level of sharpness. Generated areas are often cleaner and smoother, especially at higher ISO. At 100% zoom, a smooth patch in a grainy photo looks pasted in.
To add grain without destroying the layer:
- Right-click the generative layer and choose Convert to Smart Object. This keeps the mask and the layer, but Properties-panel variations and prompt editing are no longer available. Do this only when you are satisfied with the content.
- Choose Filter > Noise > Add Noise.
- Set Amount to 1 to 3 percent for low-ISO photos or 4 to 8 percent for noisy ones. Choose Gaussian distribution and check Monochromatic.
- Zoom to 100% and compare.
Alternatively, fill a new layer with 50% gray, set its blend mode to Overlay, add noise to it, and clip it to the generative layer. This keeps the noise separate, so you can lower its opacity later without touching the filter.
Iterating: regenerating on smaller areas
Iteration is not just pressing Generate again. Each new generation produces three variations in the Properties panel. If none is right, the usual cause is that the selection asked for too much. Narrow the problem.
Strategies that improve the next attempt
- Select only the failing region. If a generated person has bad hands, select the hands and a small margin, not the whole person. The model concentrates on a smaller, more specific task.
- Include context in the selection edge. Extend the selection slightly past the problem into clean surrounding pixels, so the model sees what the area should match.
- Change the prompt. Add the missing detail ("hands resting on a wooden table") or simplify it. An empty prompt lets Photoshop infer content from the surroundings, which is often best for texture and background repair.
- Stack generations. Each new generation creates its own layer. You can keep a good body and replace only the face on a separate layer, and each layer has its own mask.
- Work at the right zoom. Generate at the zoom level where the problem is visible. Always judge the final result at 100%.
Stacked layers or one layer
Stacking keeps every step editable. The cost is a long Layers panel. Group related generative layers into a folder named for the task, such as "Sky fix", and keep the order clear. When the image is final and you want a single flattened version, use Layer > Merge Visible with a copy kept for editing, or create a stamp-visible layer with Ctrl+Alt+Shift+E (Windows) or Cmd+Option+Shift+E (Mac).
A worked example
You extended a landscape photo to the right with Generative Expand. Three problems appear: the new sky is slightly more blue than the original, a faint vertical line shows at the seam, and the grass in the new area is smoother than the rest.
- Check content first. The new area looks plausible, so you do not regenerate.
- Fix the seam. Alt/Option-click the mask. The edge is nearly hard. Use the Gradient tool, Foreground to Transparent, black foreground, and drag a short gradient across the seam on the mask. The line fades.
- Fix the color. Add a Color Balance adjustment clipped to the generative layer. In Midtones, move the Cyan-Red slider a few points toward Red and the Blue-Yellow slider toward Yellow until the sky matches.
- Fix the texture. Create a 50% gray Overlay layer clipped to the generative layer, add 3 percent Gaussian monochromatic noise, and check at 100%.
- Check the whole image. Zoom out, hide and show the group, and confirm that the edit does not draw the eye.
The original photo is untouched, and every step can be turned off or adjusted.
Common errors
| Error | Cause | Fix |
|---|---|---|
| Painting white on the mask does nothing | The pixels were never generated in that area | Regenerate with a larger selection |
| Adjustment changes the whole image | The adjustment layer is not clipped | Create a clipping mask on it |
| Prompt and variations are missing | The layer was converted to a Smart Object or rasterized | Undo, or return to a saved duplicate |
| Halo appears again after edits | The mask was painted with a hard brush | Repaint with a soft brush at low opacity |
| Each regeneration looks worse | The selection is too large or the prompt too complex | Select a smaller area and simplify the prompt |
Exercise
A generated sky patch matches the photo's content but looks too cool in color, and a thin bright line shows at its upper edge. Name the two fixes you would apply, which layer each one goes on, and why you would not regenerate.
Show answer
Fix the color with a Color Balance (or Photo Filter) adjustment layer clipped to the generative layer, so it only changes the generated pixels. Fix the line by painting with a soft, low-opacity black brush, or a Foreground to Transparent gradient, on the generative layer's mask along the edge. Regenerating is unnecessary because the content is correct. Both problems are tone and edge issues, which the clipped adjustment and the mask solve without losing the current result.
Exercise
You paint white on a generative layer's mask to recover detail beyond your original selection, but nothing appears. Why, and what should you do?
Show answer
The generative layer only contains pixels for the area Photoshop generated. Outside that area the mask has nothing to reveal. Make a new selection that covers the larger area, with some context around it, and generate again.