Adding Text Behind an Image with ComfyUI
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.
The 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
The Process
So, it’s like taking a very sharp sashimi knife and slicing the image by carefully removing the subject and then adding the text behind it. It’s 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, it’s 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.
The Workflow
For a preview of the resulting image, 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.
Results
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.
Conclusion
I hope you like using this workflow and have fun extending it to do more.
FAQs
Q: What is the purpose of this workflow?
A: The purpose of this workflow is to add text behind an image using ComfyUI.
Q: How do I use this workflow?
A: You can use this workflow by installing the necessary nodes from the Essentials bundle and following the steps outlined in the article.
Q: What is the output of this workflow?
A: The output of this workflow is a preview of the resulting image, which can be saved as an image using the Save Image node.

