Selecting the generated subject with Photoshop's quick selection tool and placing that selection as a mask over a different, upscaled background.
This is a manual Photoshop step that complements generation. See Generate, then correct: alternating model output with Photoshop edits. Matching light and color beforehand follows the same idea as lighting-harmony-block, applied by choosing the plate instead of by writing the prompt.
A replacement background is easy to composite when its lighting direction and color mood already match the generated scene. In the host's example, the position of the bridge in the background could be matched as well, so the mask edge needed little fixing.
Generating or choosing a background that already agrees with the subject's light saves color-matching work afterwards; see Generating a custom background to use as a reference image.
A sharp, upscaled background pasted behind the subject still looks unrealistic until depth of field is rebuilt; see Field Blur with pins for depth of field.
In the ComfyUI relight workflow (Staged relight-then-restore-detail pipeline for product photography), subject masking uses a Segment Anything group driven by GroundingDINO. A text noun names the subject, for example 'bottle', 'bag' or 'microphone'. It masks the original subject, which is then merged on top of the generated background (Depth and lineart background generation) to give the blended composite that goes to IC-Light relighting (Stable Diffusion 1.5).
Apply: change the noun in the GroundingDINO node to match the subject in each new image.
The same mask is reused later as the blend mask in Mask-based high-frequency blend, so the subject is segmented once. Segmentation can miss parts of complex subjects (see Limits of the IC-Light + frequency-separation workflow).