Generating AI images inside of Sanity CMS

Duration: 2:33

Looking to use replicate directly inside of Sanity CMS? Well we've got just the plugin for you. You can download it here: https://www.npmjs.com/package/sanity-plugin-image-gen

Frequently asked questions

What is Replicate AI?
Replicate is a platform that lets you run open-source AI models, including image generation models, through a single API. In this plugin we point at Replicate to generate images on demand from a text prompt, instead of opening another tab and pasting the result back into the CMS.
How do you generate AI images inside Sanity CMS?
Install the sanity-plugin-image-gen plugin, add your Replicate API key, and an editor can type a prompt directly inside Sanity and get an image back without leaving the studio. The plugin runs through Next.js API routes and uploads the chosen image straight into the document.
What does sanity-plugin-image-gen do?
It adds a "Generate image" action inside Sanity Studio so editors can turn a prompt into an image without leaving the CMS. It supports advanced options like aspect ratio, image size, the number of variants generated, and negative prompts.
Does Sanity have AI image generation built in?
Not natively. Sanity itself does not ship an image generator. The sanity-plugin-image-gen plugin from Roboto Studio bridges Sanity Studio to Replicate so you can generate images from prompts inside the editor. You bring your own Replicate API key.
Can I use Replicate with Sanity CMS?
Yes. The plugin calls the Replicate API from a Next.js API route in your app, which means any image model Replicate hosts is available from inside Sanity Studio. You can swap the underlying model and tweak the default prompt prefix to suit your house style.
Is Sanity CMS good for AI image workflows?
Sanity is well suited because its plugin model and custom input components make it easy to embed generators directly in the editing experience. With this plugin, the AI step is part of the editor's normal flow rather than a separate tool, which is what makes it useful for blogs and landing pages.


Continue watching

Get in touch

Fill out the form below and we'll get back to you