AI tools
November 28, 2023

This Free AI Tool Lets You Create Cool Optical Illusion

This AI tool can generate super cool optical illusions from simple text descriptions.

Jim Clyde Monge
by 
Jim Clyde Monge

Just when the AI hype seemed to feel like a leisurely local train ride (I mean slow), a fresh, trending AI tool reignited my excitement. The new AI tool is called Illusion Diffusion and can generate optical illusion images from an image pattern.

Take a look at some of the sample images that are trending on Twitter.

Optical Diffusion trending Twitter images
Optical Diffusion trending Twitter images

Try it yourself

The easiest and cheapest way to try this AI tool is through HuggingFace. Simply create an account and go to the Illusion Diffusion space.

There might be a long queue due to the high number of users concurrently using the app. I suggest you duplicate the space before generating images.

Illusion diffusion hugging face
Image by Jim Clyde Monge

Let’s try an example with this prompt:

Prompt: A secluded courtyard of a Roman villa during the Renaissance era, with ornate sculptures, a central fountain, and ivy-covered walls.

Illusion Diffusion: A secluded courtyard of a Roman villa during the Renaissance era, with ornate sculptures, a central fountain, and ivy-covered walls.
Image by Jim Clyde Monge

How cool is that?

Here are more examples:

Prompt: The heart of a cyberpunk city, modeled after a Roman forum, illuminated by neon signs in Latin, with hovercrafts zipping between ancient columns adorned with digital screens.

Illusion Diffusion: The heart of a cyberpunk city, modeled after a Roman forum, illuminated by neon signs in Latin, with hovercrafts zipping between ancient columns adorned with digital screens.
Image by Jim Clyde Monge

Prompt: Ancient, gnarled trees with clock faces naturally embedded in their trunks, their hands moving ever so slowly.

Illusion diffusion: Ancient, gnarled trees with clock faces naturally embedded in their trunks, their hands moving ever so slowly.
Image by Jim Clyde Monge

Prompt: beautiful and immersive magical town, magical buildings, bioluminescent forest surrounding, gentle rivers flowing through town, visual novel key visual, award — winning digital art on pixiv, trending on artstation — highly detailed, hyperrealistic, unreal engine 5, in the style of kingdom hearts

Illusion Diffusion: beautiful and immersive magical town, magical buildings, bioluminescent forest surrounding, gentle rivers flowing through town, visual novel key visual, award — winning digital art on pixiv, trending on artstation — highly detailed, hyperrealistic, unreal engine 5, in the style of kingdom hearts
Image by Jim Clyde Monge

Also, you are not limited to these spirals and checker box patterns because you can use any pattern you want. Take a look at this incredible example with the Fusion Art AI tool.

Fusion Art AI sample image twitter logo
Fusion Art AI sample image

Remember, you’re not confined to spirals or checkerboard patterns. Your creativity is the limit!

How does it work?

Illusion Diffusion uses ControlNet for Stable Diffusion, particularly the Monster Labs image model. ControlNet allows you to copy compositions or human poses from a reference image.

ControlNet for Stable Diffusion
ControlNet for Stable Diffusion
  1. ControlNet processes the input image and detects its edges with the Canny edge detector. This results in a “control map” that features the detected edges.
  2. The control map then guides the ControlNet model alongside a text prompt.
  3. After extracting edges from the input image, Openpose steps in. This human keypoint detection model pinpoints details like hand, leg, and head positions.
  4. With all this data, Stable Diffusion creates a completely new image.

If you want to know more about the backend implementation, you can reach out to the original creator, MrUgleh.

API endpoints

If you are a developer and are interested in creating an app around this AI tool, you can check out the HuggingFace API documentation.

Use the gradio_client Python library or the @gradio/client JavaScript package to query the demo via API.

import { client } from "@gradio/client";const response_0 = await fetch("https://raw.githubusercontent.com/gradio-app/gradio/main/test/test_files/bus.png");const exampleImage = await response_0.blob();const app = await client("https://ap123-illusiondiffusion.hf.space/");const result = await app.predict(3, [      "Howdy!", // string  in 'Prompt' Textbox component    exampleImage,  // blob in 'Illusion Diffusion Output' Image component ]);console.log(result.data);

Web apps

I did a quick check and found several web apps offering similar tools, trending on platforms like Twitter and Product Hunt.

FusionArt AI

FusionArt AI dashboard
FusionArt AI dashboard

Spirals

Spirals web app dashboard

Fal AI

Fal AI sample image
Fal AI sample image

Okay, that’s about it. What do you think of this AI tool?

Final Thoughts

I am incredibly excited to see how people continue to use cutting-edge AI technologies in new and creative ways.

I can imagine several useful applications for Illusion Diffusion, such as:

  • Creating optical illusion wall art
  • Developing a game app where users guess the hidden figure in an image
  • Using it as inspiration for 3D gaming assets or environments
  • Designing super cool brand logos

The possibilities are endless; you just need to let your mind wander to create some truly amazing artwork.

‍

Get your brand or product featured on Jim Monge's audience