Artificial Intelligence in Plain English

New AI, ML and Data Science articles every day. Follow to join our 3.5M+ monthly readers.

Follow publication

Subliminal Shapes and words in images using ComfyUI, ControlNet, and Stable Diffusion

--

Hey there! Today I will show you how to generate images with subliminal text and shape such as the image below.

This tutorial is for Linux. However you might get some insights on how to do it on Windows or Mac in the provided ComfyUI Github repo.

Result

1. Getting ready

First you will need a black text or shape on a white background image that you will use as your mask. For example, the name of my company Tomorrow Theory:

PNG text mask

2. Preparing environment (NVIDIA)

pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu118 xformers

3. Download and install ComfyUI

Here you need to clone the ComfyUI Github repo.

git clone https://github.com/comfyanonymous/ComfyUI
cd ComfyUI
pip install -r requirements.txt

4. Download and install the models

You will need to download two models:

Now you are ready to start ComfyUI

5. Start ComfyUI

At the root of your project, run:

python3 main.py

Your server should start on http://127.0.0.1:8188/

6. Build the workflow

If you are familiar with ComfyUI it won’t be difficult, see the screenshoture of the complete workflow above.

If you are not familiar with ComfyUI, you can find the complete workflow on my GitHub here. Just download workflow.json, go to ComfyUI, click Load on the navigator and select the workflow.json file you just downloaded.

Make sure that:

  • Load Checkpoint is set to Realistic_Vision_V2.0.safetensors
  • Load ControlNet is set to control_v1p_sd15_qrcode_monster.safetensors

7. Upload your image

Upload your image on the Load Image block.

8. Adjust the desired output image format

Inside the Empty Latent Image block adjust the width and height according to your mask format, for example, in my case the format of “Tomorrow Theory” mask is 962 x 544 (16:9).

The format of the mask and of the image NEED to be the same in order to get a good result.

You can adjust the batch_size if you want to generate several images at the time. Otherwise, keep it at 1.

9. Check the last parameters

Check if the value of KSampler and Apply ControlNet (Advanced) match the screenshots below.

KSampler
Apply ControlNet (Advanced)

10. Add your positive and negative prompts

Here I entered as positive prompt : “plate of sushi” and negative prompt “worst quality poor details unrealistic”.

You can adjust positive and negative prompts according to your needs (I recommend to keep the same negative prompt to start with).

11. Generate your first image!

Click on “Queue Prompt” to start generating your image.

Your image will appear on the Save Image block.

12. Tweak the settings to get the best results

According to your mask and the degree of visibility you want on the final image, you can modify the strength under Apply ControlNet block.

I found the best results between 1.1 and 1.5, try to find your sweet spot!

13. Enjoy you new superpower!

Mmmh sushi

You can find all your generated images under ComfyUI/output

Hope you enjoyed this tutorial, please share it to the world!

In Plain English

Thank you for being a part of our community! Before you go:

--

--

Published in Artificial Intelligence in Plain English

New AI, ML and Data Science articles every day. Follow to join our 3.5M+ monthly readers.

Written by Gaspard Tertrais

French entrepreneur, author & tech innovator. Co-founder @TomorrowTheory HR tech, AI, Blockchain, XR, Web3 & Psychedelics https://linktr.ee/gaspard.tertrais

Responses (2)

Write a response