There are some Loras for double exposure effect which work great. Just with a prompt like "object A, object B, background C" we can get an amazing result. However, it seems that we don't have lots of control on the appearance and composition of A and B. Good prompting skill might help, but the steps described here could be an alternative.
The idea is to generate 2 images in a flow, e.g. a face and a scene. We use a background remover, like RMBG v1.4, to extract the face; and blend it with the scene. In ComfyUI we use the node "Image Composite Masked" to put the masked face into the scene; and later "Image Blend" to blend the result with, again, the scene. A direct blending of the masked face with the scene will currently give an error message.
Since the face and the scene are independently generated, we should have lots of control on how both images look like. We may use different styles, or even different models. Of course we might also utilize controlnet, embedding, lora, etc. to get the initial images we want. Furthermore, we can also extract two masks instead of one, and apply it to any of the image, or both. In addition, the blending factor and the blending mode are also adjustable, so that there are many options to play around.
The four examples in this post were created with the same generation data:
model: Dreamshaper XL Turbo
negative prompt: "bw, monochrome, signature, sketch, text, watermark"
seed: 1 (fixed)
sampler: DPM++ SDE Karras
steps: 5
CFG: 2
denoising strength: 1
size: 768 x 1152
no embedding, lora, controlnet, etc.
Only the positive prompts vary.
The prompts:
"face of Mahatma Gandhi as a 4-star general in battle uniform, color photo" and "stormtroopers, full body, holding white flag"
face of Greta Thunberg, art by Dustin_Nguyen" and "toy figurine of fat and naked Donald Trump, angry, shouting, (crucified on a cross) in an Arabian desert"
"face of Darth Vader, art by Carne_Griffiths" and "dramatic space battle involving (Borg cube illuminated in green), attacking space ships, explosions, laser beams, space debris"
"Gandalf and Albus Dumbledore facing to each other" and "Frodo Baggins, closeup, facing to viewer, wearing round glasses, wearing Hogwarts school uniform"
The complete flows as jons file can be downloaded here.