Ever in the need of adding some text in the image, well that’s easy with any image editor. Well the trickiness comes when you want to add the text in between the Subject and the Background so the image is sliced up and then merged back in three layers.
- Layer 1 – Foreground subject of the image
- Layer 2 – Text you want to insert (behind the subject)
- Layer 3 – The background of the image
So its like taking a very sharp sashimi knife and slicing the image by carefully removing the subject and then adding the text behind it.
Its quite easily done in ComfyUI using BirefNet General model which will remove the background from the image thereby giving you a cleanly separate image of the subject.
Now that you have the subject its about building the three layers in ComfyUI Workflow and creating the merged image.
For this we need to utilise a few nodes from the Essentials bundle. Install these using your ComfyUI Manager or when you load the workflow use the Install Missing Nodes option.
My workflow only produces a Preview of the resulting image. If you wish to save the final Image you need to replace the Preview Image with Save Image node.
Download
The download is available here, click on the button to get the ZIp file containing the workflow in two formats PNG and JSON.
Add Text Behind Image Workflow (47 downloads )Here are some of the resulting images I have managed to produce with this workflow. Pretty neat that you can achieve all this just using ComfyUI
I even created this post’s thumbnail using my workflow so no Photoshop was needed for this. The original image was generate in Flux.Dev and then run through my workflow to add the text. It took a few attempts to get the size and position to my liking but it was good fun.
I hope you like using this workflow and have fun extending it to do more.
If you'd like to support our site please consider buying us a Ko-fi, grab a product or subscribe. Need a faster GPU, get access to fastest GPUs for less than $1 per hour with RunPod.io