Bunnies are going to Broadcast Asia in Singapore! 🐰 - Let's dive into your future success with bunny.net🚀

Book a Meeting
x

Introducing Bunny AI: The easiest way to dynamically generate images

Posted by:

Every now and then, a new piece of technology creates a radical shift throughout the world in how people interact with computers. One such shift is currently underway as we speak. It is the rise of AI. Recent breakthroughs have been incredibly exciting to observe. One of the recent innovations has been the rise of generative image models that produce stunning images out of text prompts. Being obsessed with innovation, here at bunny.net, we've been eagerly following along.

At bunny.net, we believe the future brings a fundamental change where content won't just be cached on the edge, but, eventually, generated there as well. Today, we're excited to announce our first step in that direction with Bunny AI, an experimental multi-model image generation engine that brings the easiest way to generate images dynamically, straight on the CDN. Generating an image is now as simple as loading a specially crafted URL.

Why Bunny AI?

We were thrilled to see the advancements in AI, and we wanted to allow developers to leverage this system in the easiest way possible to empower applications with dynamic image generation, such as dynamic profile avatars, game characters or items, or even blog post images, placeholders, and more.

The first and most powerful use-case we saw was dynamic profile avatar generation, so naturally, we made bunny.net itself our first real-world use-case.

Thanks to Bunny AI, we were able to replace the boring gray profile placeholder image with cute, colorful pixel art renders of countless unique bunnies. We used the MD5 hash of your email to generate a random seed for each of our accounts. The result is a cute pixel bunny avatar for anyone not using a Gravatar profile image.

How does it work?

Being focused on helping developers build a faster internet, we didn't go out and build our own models. Instead, we partnered with two incredible companies that have been making huge strides in the industry, OpenAI and StabilityAI.

Each of them provides a model with its own strengths and weaknesses, and we believe the best way to achieve great results consistently is to use the model best suited for the desired output.

DALLE-2 is fantastic for things like pixel art, or more creative prompt renditions, whereas StabilityAI with its Stable Diffusion model is great for more photorealistic prompts such as photos or realistic illustrations.

Bunny AI allows you to easily toggle different "engines" to switch between generative models and resolutions based on your desired outputs.

Making generating easy with Blueprints

Our primary goal was to make dynamic generation as simple as possible and keep clean URL structures. To do that, we introduced Blueprints, a feature similar to Image Classes. It allows you to define pre-prompt and post-prompt messages as well as other generation parameters.

For example, we created a demo cyberpunk style that automatically prepends "cyberpunk avatar" and appends "cyber tech with colorful background pastel colors, digital art" to your prompt. This allows you to generate images of various motives in the same style with a simple word such as "bunny" or "panda".

This creates more pleasing URLs for your end-users and makes them a bit more SEO friendly.

Dynamic processing with Bunny Optimizer integration

To help push things further, Bunny AI Image Generation also allows you to dynamically generate images using Bunny Optimizer to resize, crop, sharpen the images, and more using simple query parameters.

Together, Bunny AI and Bunny Optimizer create a really powerful tool for dynamic image generation for various different use-cases. Putting it all together, it's this simple to generate a couple of unique image of a bunny pixel avatar and resize them to 128 pixels:

https://bunnynet-avatars.b-cdn.net/.ai/img/dalle-256/avatar/email-1/rabbit.jpg?width=128
https://bunnynet-avatars.b-cdn.net/.ai/img/dalle-256/avatar/email-2/rabbit.jpg?width=128
https://bunnynet-avatars.b-cdn.net/.ai/img/dalle-256/avatar/email-3/rabbit.jpg?width=128
https://bunnynet-avatars.b-cdn.net/.ai/img/dalle-256/avatar/email-4/rabbit.jpg?width=128
https://bunnynet-avatars.b-cdn.net/.ai/img/dalle-256/avatar/email-5/rabbit.jpg?width=128

Simple security through Token Authentication

To prevent abuse and intentional cost burning, Bunny AI enforces the Bunny CDN token authentication. To generate an image, each URL needs to be signed using a specially crafted token. This can be achieved with a few lines of code, and we already provide samples in PHP, C#, JavaScript, and Python.

If you need an example in a different language, you can also reach out to our Super Bunnies and they will be happy to assist you.

If you don't want to mess with tokens at all, the simple generator tool inside of the panel already pre-signs the requests for you and generates the tokens as needed. Or, if you have sufficient control over your content output, you can even disable tokens entirely using an edge rule.

Try it out yourself!

Bunny AI is currently available free of charge during the experimental preview release and is enabled for every bunny.net user. We want to invite everyone to have a look and play around, and share the results with us. Bunny AI is released as an experimental feature, and we would love to hear your feedback.

To enable Bunny AI, simply enable the feature under the Bunny AI panel and start generating, or check out the documentation on Bunny Docs.

Help us make the internet hop faster!

At our core, bunny.net is focused on building a faster internet, and we're working on some exciting projects with deep AI integration. If you're an expert in AI that connects with our mission, and would like to help us shape how people connect to the internet, make sure to check out our careers page. We would love to have you onboard.