{"id":"youtube:2v2Yge5-eLY","source":"youtube","sourceId":"2v2Yge5-eLY","account":"robotostudio","type":"video","title":"Generating AI images inside of Sanity CMS","body":"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","bodyFormat":"text","sourceUrl":"https://www.youtube.com/watch?v=2v2Yge5-eLY","canonicalUrl":"https://robotostudio.com/videos/generating-ai-images-inside-of-sanity-cms","sourceUrls":["https://robotostudio.com/videos/generating-ai-images-inside-of-sanity-cms"],"authorIds":["https://robotostudio.com/blog/author/jono#person"],"publishedAt":"2025-03-04T00:00:00.000Z","modifiedAt":"2026-08-11","checkedAt":"2026-09-17T13:02:04.791Z","language":"en","visibility":"public","topics":["sanity","nextjs","editorial-experience","ai"],"gaps":["Video authors are credited by the original Roboto page; individual transcript speakers remain unassigned."],"segments":[{"id":"segment-1","startMs":2149,"endMs":2159,"text":"hey folks how's it going we're back"},{"id":"segment-2","startMs":2159,"endMs":3949,"text":"hey folks how's it going we're back\nagain so um I just want to show you"},{"id":"segment-3","startMs":3949,"endMs":3959,"text":"again so um I just want to show you"},{"id":"segment-4","startMs":3959,"endMs":5309,"text":"again so um I just want to show you\nsomething very cool that we've built in"},{"id":"segment-5","startMs":5309,"endMs":5319,"text":"something very cool that we've built in"},{"id":"segment-6","startMs":5319,"endMs":6829,"text":"something very cool that we've built in\nhouse and I'm fairly certain that a lot"},{"id":"segment-7","startMs":6829,"endMs":6839,"text":"house and I'm fairly certain that a lot"},{"id":"segment-8","startMs":6839,"endMs":8509,"text":"house and I'm fairly certain that a lot\nof people are going to get a lot of use"},{"id":"segment-9","startMs":8509,"endMs":8519,"text":"of people are going to get a lot of use"},{"id":"segment-10","startMs":8519,"endMs":10950,"text":"of people are going to get a lot of use\nout of this so if you notice we have"},{"id":"segment-11","startMs":10950,"endMs":10960,"text":"out of this so if you notice we have"},{"id":"segment-12","startMs":10960,"endMs":12910,"text":"out of this so if you notice we have\nthis new little thing inside of Sanity"},{"id":"segment-13","startMs":12910,"endMs":12920,"text":"this new little thing inside of Sanity"},{"id":"segment-14","startMs":12920,"endMs":15390,"text":"this new little thing inside of Sanity\ncalled generate image now the reason why"},{"id":"segment-15","startMs":15390,"endMs":15400,"text":"called generate image now the reason why"},{"id":"segment-16","startMs":15400,"endMs":17390,"text":"called generate image now the reason why\nwe built this is we built it because we"},{"id":"segment-17","startMs":17390,"endMs":17400,"text":"we built this is we built it because we"},{"id":"segment-18","startMs":17400,"endMs":19029,"text":"we built this is we built it because we\nkept going to replicate we kept taking"},{"id":"segment-19","startMs":19029,"endMs":19039,"text":"kept going to replicate we kept taking"},{"id":"segment-20","startMs":19039,"endMs":20230,"text":"kept going to replicate we kept taking\nthe data from there and we kept throwing"},{"id":"segment-21","startMs":20230,"endMs":20240,"text":"the data from there and we kept throwing"},{"id":"segment-22","startMs":20240,"endMs":22550,"text":"the data from there and we kept throwing\nit back into our blogs and depending on"},{"id":"segment-23","startMs":22550,"endMs":22560,"text":"it back into our blogs and depending on"},{"id":"segment-24","startMs":22560,"endMs":24710,"text":"it back into our blogs and depending on\nhow good you are at doing that um it can"},{"id":"segment-25","startMs":24710,"endMs":24720,"text":"how good you are at doing that um it can"},{"id":"segment-26","startMs":24720,"endMs":26550,"text":"how good you are at doing that um it can\ntake anywhere between like 15 seconds to"},{"id":"segment-27","startMs":26550,"endMs":26560,"text":"take anywhere between like 15 seconds to"},{"id":"segment-28","startMs":26560,"endMs":28509,"text":"take anywhere between like 15 seconds to\na minute which is very very you know"},{"id":"segment-29","startMs":28509,"endMs":28519,"text":"a minute which is very very you know"},{"id":"segment-30","startMs":28519,"endMs":30669,"text":"a minute which is very very you know\nfrustrating over time especially when"},{"id":"segment-31","startMs":30669,"endMs":30679,"text":"frustrating over time especially when"},{"id":"segment-32","startMs":30679,"endMs":31870,"text":"frustrating over time especially when\nyou're trying to create something on the"},{"id":"segment-33","startMs":31870,"endMs":31880,"text":"you're trying to create something on the"},{"id":"segment-34","startMs":31880,"endMs":33110,"text":"you're trying to create something on the\nFly and you just don't want to lose that"},{"id":"segment-35","startMs":33110,"endMs":33120,"text":"Fly and you just don't want to lose that"},{"id":"segment-36","startMs":33120,"endMs":36790,"text":"Fly and you just don't want to lose that\neditorial flow so um this is a plugin"},{"id":"segment-37","startMs":36790,"endMs":36800,"text":"editorial flow so um this is a plugin"},{"id":"segment-38","startMs":36800,"endMs":39110,"text":"editorial flow so um this is a plugin\nthat you can now add into sanity and it"},{"id":"segment-39","startMs":39110,"endMs":39120,"text":"that you can now add into sanity and it"},{"id":"segment-40","startMs":39120,"endMs":42150,"text":"that you can now add into sanity and it\nruns using the nextjs API routes um I'm"},{"id":"segment-41","startMs":42150,"endMs":42160,"text":"runs using the nextjs API routes um I'm"},{"id":"segment-42","startMs":42160,"endMs":43229,"text":"runs using the nextjs API routes um I'm\ngoing to show you that in a second it's"},{"id":"segment-43","startMs":43229,"endMs":43239,"text":"going to show you that in a second it's"},{"id":"segment-44","startMs":43239,"endMs":44830,"text":"going to show you that in a second it's\ngoing to show you how to set it up um"},{"id":"segment-45","startMs":44830,"endMs":44840,"text":"going to show you how to set it up um"},{"id":"segment-46","startMs":44840,"endMs":46189,"text":"going to show you how to set it up um\nand if you are interested in seeing a"},{"id":"segment-47","startMs":46189,"endMs":46199,"text":"and if you are interested in seeing a"},{"id":"segment-48","startMs":46199,"endMs":48150,"text":"and if you are interested in seeing a\nwhole video about how to set this thing"},{"id":"segment-49","startMs":48150,"endMs":48160,"text":"whole video about how to set this thing"},{"id":"segment-50","startMs":48160,"endMs":49670,"text":"whole video about how to set this thing\nup we're more than happy to do that as"},{"id":"segment-51","startMs":49670,"endMs":49680,"text":"up we're more than happy to do that as"},{"id":"segment-52","startMs":49680,"endMs":51470,"text":"up we're more than happy to do that as\nwell but first of all let's get some"},{"id":"segment-53","startMs":51470,"endMs":51480,"text":"well but first of all let's get some"},{"id":"segment-54","startMs":51480,"endMs":53229,"text":"well but first of all let's get some\ncute kittens in"},{"id":"segment-55","startMs":53229,"endMs":53239,"text":"cute kittens in"},{"id":"segment-56","startMs":53239,"endMs":55270,"text":"cute kittens in\nhere right let's generate that so I'm"},{"id":"segment-57","startMs":55270,"endMs":55280,"text":"here right let's generate that so I'm"},{"id":"segment-58","startMs":55280,"endMs":56750,"text":"here right let's generate that so I'm\njust typing in cute kittens I'm going to"},{"id":"segment-59","startMs":56750,"endMs":56760,"text":"just typing in cute kittens I'm going to"},{"id":"segment-60","startMs":56760,"endMs":58709,"text":"just typing in cute kittens I'm going to\nhit generate and there you go boom that"},{"id":"segment-61","startMs":58709,"endMs":58719,"text":"hit generate and there you go boom that"},{"id":"segment-62","startMs":58719,"endMs":60430,"text":"hit generate and there you go boom that\nis from replicate they look a little bit"},{"id":"segment-63","startMs":60430,"endMs":60440,"text":"is from replicate they look a little bit"},{"id":"segment-64","startMs":60440,"endMs":62590,"text":"is from replicate they look a little bit\nunsettling that's exactly what we want"},{"id":"segment-65","startMs":62590,"endMs":62600,"text":"unsettling that's exactly what we want"},{"id":"segment-66","startMs":62600,"endMs":64950,"text":"unsettling that's exactly what we want\nbut um we have this whole Advanced"},{"id":"segment-67","startMs":64950,"endMs":64960,"text":"but um we have this whole Advanced"},{"id":"segment-68","startMs":64960,"endMs":66469,"text":"but um we have this whole Advanced\noptions section and we can do a lot of"},{"id":"segment-69","startMs":66469,"endMs":66479,"text":"options section and we can do a lot of"},{"id":"segment-70","startMs":66479,"endMs":68109,"text":"options section and we can do a lot of\nclever stuff in here everything from"},{"id":"segment-71","startMs":68109,"endMs":68119,"text":"clever stuff in here everything from"},{"id":"segment-72","startMs":68119,"endMs":70310,"text":"clever stuff in here everything from\nchanging like the aspect ratio to the"},{"id":"segment-73","startMs":70310,"endMs":70320,"text":"changing like the aspect ratio to the"},{"id":"segment-74","startMs":70320,"endMs":72429,"text":"changing like the aspect ratio to the\nimage size um and to the number of"},{"id":"segment-75","startMs":72429,"endMs":72439,"text":"image size um and to the number of"},{"id":"segment-76","startMs":72439,"endMs":73350,"text":"image size um and to the number of\nkittens that you're going to get"},{"id":"segment-77","startMs":73350,"endMs":73360,"text":"kittens that you're going to get"},{"id":"segment-78","startMs":73360,"endMs":74830,"text":"kittens that you're going to get\ngenerated"},{"id":"segment-79","startMs":74830,"endMs":74840,"text":"generated"},{"id":"segment-80","startMs":74840,"endMs":77030,"text":"generated\nso um and of course we can do things"},{"id":"segment-81","startMs":77030,"endMs":77040,"text":"so um and of course we can do things"},{"id":"segment-82","startMs":77040,"endMs":78350,"text":"so um and of course we can do things\nlike negative prompts so we could put"},{"id":"segment-83","startMs":78350,"endMs":78360,"text":"like negative prompts so we could put"},{"id":"segment-84","startMs":78360,"endMs":79990,"text":"like negative prompts so we could put\nugly kittens in here as a negative"},{"id":"segment-85","startMs":79990,"endMs":80000,"text":"ugly kittens in here as a negative"},{"id":"segment-86","startMs":80000,"endMs":82950,"text":"ugly kittens in here as a negative\nprompt but you'll see nice very very"},{"id":"segment-87","startMs":82950,"endMs":82960,"text":"prompt but you'll see nice very very"},{"id":"segment-88","startMs":82960,"endMs":85069,"text":"prompt but you'll see nice very very\ncute very nice um and you can"},{"id":"segment-89","startMs":85069,"endMs":85079,"text":"cute very nice um and you can"},{"id":"segment-90","startMs":85079,"endMs":86590,"text":"cute very nice um and you can\nessentially just click any of these so"},{"id":"segment-91","startMs":86590,"endMs":86600,"text":"essentially just click any of these so"},{"id":"segment-92","startMs":86600,"endMs":88710,"text":"essentially just click any of these so\nif I like this one best I can hit it"},{"id":"segment-93","startMs":88710,"endMs":88720,"text":"if I like this one best I can hit it"},{"id":"segment-94","startMs":88720,"endMs":90429,"text":"if I like this one best I can hit it\nit's going to upload that data"},{"id":"segment-95","startMs":90429,"endMs":90439,"text":"it's going to upload that data"},{"id":"segment-96","startMs":90439,"endMs":91510,"text":"it's going to upload that data\nit's going to tell me we've got low"},{"id":"segment-97","startMs":91510,"endMs":91520,"text":"it's going to tell me we've got low"},{"id":"segment-98","startMs":91520,"endMs":93550,"text":"it's going to tell me we've got low\nbattery which is always great and there"},{"id":"segment-99","startMs":93550,"endMs":93560,"text":"battery which is always great and there"},{"id":"segment-100","startMs":93560,"endMs":95870,"text":"battery which is always great and there\nwe go we've got it that's it working um"},{"id":"segment-101","startMs":95870,"endMs":95880,"text":"we go we've got it that's it working um"},{"id":"segment-102","startMs":95880,"endMs":97230,"text":"we go we've got it that's it working um\nso if you're interested in using this"},{"id":"segment-103","startMs":97230,"endMs":97240,"text":"so if you're interested in using this"},{"id":"segment-104","startMs":97240,"endMs":99270,"text":"so if you're interested in using this\nit's actually available here which is"},{"id":"segment-105","startMs":99270,"endMs":99280,"text":"it's actually available here which is"},{"id":"segment-106","startMs":99280,"endMs":101630,"text":"it's actually available here which is\nsanity plug-in image gen um it's been"},{"id":"segment-107","startMs":101630,"endMs":101640,"text":"sanity plug-in image gen um it's been"},{"id":"segment-108","startMs":101640,"endMs":103149,"text":"sanity plug-in image gen um it's been\npublished 13 days ago but we've been"},{"id":"segment-109","startMs":103149,"endMs":103159,"text":"published 13 days ago but we've been"},{"id":"segment-110","startMs":103159,"endMs":104510,"text":"published 13 days ago but we've been\nkind of just tweaking around with it for"},{"id":"segment-111","startMs":104510,"endMs":104520,"text":"kind of just tweaking around with it for"},{"id":"segment-112","startMs":104520,"endMs":106789,"text":"kind of just tweaking around with it for\nthe last second um so feel free to run"},{"id":"segment-113","startMs":106789,"endMs":106799,"text":"the last second um so feel free to run"},{"id":"segment-114","startMs":106799,"endMs":108749,"text":"the last second um so feel free to run\nthis tell me if you get against uh any"},{"id":"segment-115","startMs":108749,"endMs":108759,"text":"this tell me if you get against uh any"},{"id":"segment-116","startMs":108759,"endMs":110190,"text":"this tell me if you get against uh any\nsnags or anything that's kind of"},{"id":"segment-117","startMs":110190,"endMs":110200,"text":"snags or anything that's kind of"},{"id":"segment-118","startMs":110200,"endMs":112990,"text":"snags or anything that's kind of\ndifficult to work with um and again this"},{"id":"segment-119","startMs":112990,"endMs":113000,"text":"difficult to work with um and again this"},{"id":"segment-120","startMs":113000,"endMs":114429,"text":"difficult to work with um and again this\nis all the configuration that's inside"},{"id":"segment-121","startMs":114429,"endMs":114439,"text":"is all the configuration that's inside"},{"id":"segment-122","startMs":114439,"endMs":116109,"text":"is all the configuration that's inside\nof here how to actually get it running"},{"id":"segment-123","startMs":116109,"endMs":116119,"text":"of here how to actually get it running"},{"id":"segment-124","startMs":116119,"endMs":118149,"text":"of here how to actually get it running\nit has things like type safety built in"},{"id":"segment-125","startMs":118149,"endMs":118159,"text":"it has things like type safety built in"},{"id":"segment-126","startMs":118159,"endMs":120950,"text":"it has things like type safety built in\nso it should in theory just work and you"},{"id":"segment-127","startMs":120950,"endMs":120960,"text":"so it should in theory just work and you"},{"id":"segment-128","startMs":120960,"endMs":122389,"text":"so it should in theory just work and you\nshould make it should make it a lot"},{"id":"segment-129","startMs":122389,"endMs":122399,"text":"should make it should make it a lot"},{"id":"segment-130","startMs":122399,"endMs":124590,"text":"should make it should make it a lot\neasier for you to make it work um and"},{"id":"segment-131","startMs":124590,"endMs":124600,"text":"easier for you to make it work um and"},{"id":"segment-132","startMs":124600,"endMs":127749,"text":"easier for you to make it work um and\nagain this still needs the replicate uh"},{"id":"segment-133","startMs":127749,"endMs":127759,"text":"again this still needs the replicate uh"},{"id":"segment-134","startMs":127759,"endMs":130710,"text":"again this still needs the replicate uh\nID inside of here so it needs an API key"},{"id":"segment-135","startMs":130710,"endMs":130720,"text":"ID inside of here so it needs an API key"},{"id":"segment-136","startMs":130720,"endMs":133229,"text":"ID inside of here so it needs an API key\num but ultimately all of this should in"},{"id":"segment-137","startMs":133229,"endMs":133239,"text":"um but ultimately all of this should in"},{"id":"segment-138","startMs":133239,"endMs":135110,"text":"um but ultimately all of this should in\ntheory just work and you can tweak it to"},{"id":"segment-139","startMs":135110,"endMs":135120,"text":"theory just work and you can tweak it to"},{"id":"segment-140","startMs":135120,"endMs":136390,"text":"theory just work and you can tweak it to\nexactly the way you want if you want to"},{"id":"segment-141","startMs":136390,"endMs":136400,"text":"exactly the way you want if you want to"},{"id":"segment-142","startMs":136400,"endMs":138550,"text":"exactly the way you want if you want to\nuse a specific image model you can tweak"},{"id":"segment-143","startMs":138550,"endMs":138560,"text":"use a specific image model you can tweak"},{"id":"segment-144","startMs":138560,"endMs":140630,"text":"use a specific image model you can tweak\nthat if you want to use specific prompts"},{"id":"segment-145","startMs":140630,"endMs":140640,"text":"that if you want to use specific prompts"},{"id":"segment-146","startMs":140640,"endMs":142150,"text":"that if you want to use specific prompts\nthat start at the beginning so I've seen"},{"id":"segment-147","startMs":142150,"endMs":142160,"text":"that start at the beginning so I've seen"},{"id":"segment-148","startMs":142160,"endMs":144070,"text":"that start at the beginning so I've seen\npeople use things with like iPhone"},{"id":"segment-149","startMs":144070,"endMs":144080,"text":"people use things with like iPhone"},{"id":"segment-150","startMs":144080,"endMs":145390,"text":"people use things with like iPhone\ncamera setting so it looks more"},{"id":"segment-151","startMs":145390,"endMs":145400,"text":"camera setting so it looks more"},{"id":"segment-152","startMs":145400,"endMs":147869,"text":"camera setting so it looks more\nrealistic all of that is possible with"},{"id":"segment-153","startMs":147869,"endMs":147879,"text":"realistic all of that is possible with"},{"id":"segment-154","startMs":147879,"endMs":150390,"text":"realistic all of that is possible with\nthis tool so yeah hope you like it tell"},{"id":"segment-155","startMs":150390,"endMs":150400,"text":"this tool so yeah hope you like it tell"},{"id":"segment-156","startMs":150400,"endMs":155160,"text":"this tool so yeah hope you like it tell\nme how you get on take care bye-bye"}],"transcript":"Hey folks, how's it going? We're back again. So, um, I just want to show you something very cool that we've built in-house and I'm fairly certain that a lot of people are going to get a lot of use out of this.\n\nSo if you notice, we have this new little thing inside of Sanity called Generate Image. Now, the reason why we built this is we kept going to Replicate, we kept taking the data from there, and we kept throwing it back into our blogs. And depending on how good you are at doing that, um, it can take anywhere between like 15 seconds to a minute, which is very, very, you know, frustrating over time, especially when you're trying to create something on the fly and you just don't want to lose that editorial flow.\n\nSo, um, this is a plugin that you can now add into Sanity and it runs using the Next.js API routes. Um, I'm going to show you that in a second. It's going to show you how to set it up. Um, and if you are interested in seeing a whole video about how to set this thing up, we're more than happy to do that as well. But first of all, let's get some cute kittens in here, right? Let's generate that. So I'm just typing in \"cute kittens.\" I'm going to hit generate and there you go. Boom! That is from Replicate. They look a little bit unsettling. That's exactly what we want.\n\nBut um, we have this whole Advanced Options section and we can do a lot of clever stuff in here. Everything from changing, like, the aspect ratio to the image size, um, and to the number of kittens that you're going to get generated. So, um, and of course we can do things like negative prompts. So we could put \"ugly kittens\" in here as a negative prompt. But you'll see, nice, very, very cute, very nice.\n\nUm, and you can essentially just click any of these. So if I like this one best, I can hit it. It's going to upload that data. It's going to tell me we've got low battery, which is always great. And there we go. We've got it. That's it working.\n\nUm, so if you're interested in using this, it's actually available here, which is Sanity plugin image gen. Um, it's been published 13 days ago, but we've been kind of just tweaking around with it for the last second. Um, so feel free to run this. Tell me if you get against uh any snags or anything that's kind of difficult to work with.\n\nUm, and again, this is all the configuration that's inside of here. How to actually get it running. It has things like type safety built in, so it should in theory just work and should make it a lot easier for you to get it working. Um, and again, this still needs the Replicate uh ID inside of here. So it needs an API key. Um, but ultimately, all of this should in theory just work and you can tweak it to exactly the way you want. If you want to use a specific image model, you can tweak that. If you want to use specific prompts that start at the beginning (I've seen people use things like with iPhone camera setting so it looks more realistic), all of that is possible with this tool.\n\nSo yeah, hope you like it. Tell me how you get on. Take care. Bye-bye.","transcriptOrigin":"Edited transcript from the original Roboto page","thumbnailUrl":"https://img.youtube.com/vi/2v2Yge5-eLY/maxresdefault.jpg","durationSeconds":153,"videoId":"2v2Yge5-eLY","publisherName":"Roboto Studio","faqs":[{"question":"What is Replicate AI?","answer":"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.","sourceUrl":"https://robotostudio.com/videos/generating-ai-images-inside-of-sanity-cms"},{"question":"How do you generate AI images inside Sanity CMS?","answer":"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.","sourceUrl":"https://robotostudio.com/videos/generating-ai-images-inside-of-sanity-cms"},{"question":"What does sanity-plugin-image-gen do?","answer":"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.","sourceUrl":"https://robotostudio.com/videos/generating-ai-images-inside-of-sanity-cms"},{"question":"Does Sanity have AI image generation built in?","answer":"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.","sourceUrl":"https://robotostudio.com/videos/generating-ai-images-inside-of-sanity-cms"},{"question":"Can I use Replicate with Sanity CMS?","answer":"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.","sourceUrl":"https://robotostudio.com/videos/generating-ai-images-inside-of-sanity-cms"},{"question":"Is Sanity CMS good for AI image workflows?","answer":"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.","sourceUrl":"https://robotostudio.com/videos/generating-ai-images-inside-of-sanity-cms"}],"path":"/videos/2v2Yge5-eLY/generating-ai-images-inside-of-sanity-cms","indexable":false,"contentHash":"4c419f0ea07e28da8a9621273f48c012793f56b0f893d5e16f8042737528d934","representations":{"html":"https://bestsanityagency.com/videos/2v2Yge5-eLY/generating-ai-images-inside-of-sanity-cms","markdown":"https://bestsanityagency.com/videos/2v2Yge5-eLY/generating-ai-images-inside-of-sanity-cms.md","json":"https://bestsanityagency.com/videos/2v2Yge5-eLY/generating-ai-images-inside-of-sanity-cms.json"},"generation":"bcb598ae5ec44a3005ea0356","jsonLd":{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://robotostudio.com/#organization","name":"Roboto Studio","url":"https://robotostudio.com/","sameAs":["https://clutch.co/profile/roboto-studio","https://www.youtube.com/@robotostudio","https://x.com/studioroboto"]},{"@type":"Person","@id":"https://robotostudio.com/blog/author/jono#person","name":"Jono Alford","url":"https://robotostudio.com/blog/author/jono","sameAs":["https://dev.to/jonoroboto","https://x.com/jonoalford","https://www.reddit.com/user/jonoalford/"],"worksFor":{"@id":"https://robotostudio.com/#organization"}},{"@type":"Person","@id":"https://robotostudio.com/blog/author/sne#person","name":"Sne Tripathi","url":"https://robotostudio.com/blog/author/sne","sameAs":["https://x.com/sne_hil"],"worksFor":{"@id":"https://robotostudio.com/#organization"}},{"@type":"WebSite","@id":"https://bestsanityagency.com/#website","url":"https://bestsanityagency.com","name":"Roboto Studio evidence","publisher":{"@id":"https://robotostudio.com/#organization"}},{"@type":"WebPage","@id":"https://bestsanityagency.com/videos/2v2Yge5-eLY/generating-ai-images-inside-of-sanity-cms#page","url":"https://bestsanityagency.com/videos/2v2Yge5-eLY/generating-ai-images-inside-of-sanity-cms","name":"Generating AI images inside of Sanity CMS","publisher":{"@id":"https://robotostudio.com/#organization"},"mainEntity":{"@id":"https://www.youtube.com/watch?v=2v2Yge5-eLY"},"isPartOf":{"@id":"https://bestsanityagency.com/#website"}},{"@id":"https://www.youtube.com/watch?v=2v2Yge5-eLY","name":"Generating AI images inside of Sanity CMS","url":"https://www.youtube.com/watch?v=2v2Yge5-eLY","datePublished":"2025-03-04T00:00:00.000Z","dateModified":"2026-08-11","inLanguage":"en","author":[{"@id":"https://robotostudio.com/blog/author/jono#person"}],"@type":"VideoObject","description":"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","transcript":"Hey folks, how's it going? We're back again. So, um, I just want to show you something very cool that we've built in-house and I'm fairly certain that a lot of people are going to get a lot of use out of this.\n\nSo if you notice, we have this new little thing inside of Sanity called Generate Image. Now, the reason why we built this is we kept going to Replicate, we kept taking the data from there, and we kept throwing it back into our blogs. And depending on how good you are at doing that, um, it can take anywhere between like 15 seconds to a minute, which is very, very, you know, frustrating over time, especially when you're trying to create something on the fly and you just don't want to lose that editorial flow.\n\nSo, um, this is a plugin that you can now add into Sanity and it runs using the Next.js API routes. Um, I'm going to show you that in a second. It's going to show you how to set it up. Um, and if you are interested in seeing a whole video about how to set this thing up, we're more than happy to do that as well. But first of all, let's get some cute kittens in here, right? Let's generate that. So I'm just typing in \"cute kittens.\" I'm going to hit generate and there you go. Boom! That is from Replicate. They look a little bit unsettling. That's exactly what we want.\n\nBut um, we have this whole Advanced Options section and we can do a lot of clever stuff in here. Everything from changing, like, the aspect ratio to the image size, um, and to the number of kittens that you're going to get generated. So, um, and of course we can do things like negative prompts. So we could put \"ugly kittens\" in here as a negative prompt. But you'll see, nice, very, very cute, very nice.\n\nUm, and you can essentially just click any of these. So if I like this one best, I can hit it. It's going to upload that data. It's going to tell me we've got low battery, which is always great. And there we go. We've got it. That's it working.\n\nUm, so if you're interested in using this, it's actually available here, which is Sanity plugin image gen. Um, it's been published 13 days ago, but we've been kind of just tweaking around with it for the last second. Um, so feel free to run this. Tell me if you get against uh any snags or anything that's kind of difficult to work with.\n\nUm, and again, this is all the configuration that's inside of here. How to actually get it running. It has things like type safety built in, so it should in theory just work and should make it a lot easier for you to get it working. Um, and again, this still needs the Replicate uh ID inside of here. So it needs an API key. Um, but ultimately, all of this should in theory just work and you can tweak it to exactly the way you want. If you want to use a specific image model, you can tweak that. If you want to use specific prompts that start at the beginning (I've seen people use things like with iPhone camera setting so it looks more realistic), all of that is possible with this tool.\n\nSo yeah, hope you like it. Tell me how you get on. Take care. Bye-bye.","thumbnailUrl":"https://img.youtube.com/vi/2v2Yge5-eLY/maxresdefault.jpg","embedUrl":"https://www.youtube.com/embed/2v2Yge5-eLY","uploadDate":"2025-03-04T00:00:00.000Z","duration":"PT153S","publisher":{"@type":"Organization","name":"Roboto Studio"},"caption":{"@type":"MediaObject","contentUrl":"https://bestsanityagency.com/videos/2v2Yge5-eLY/generating-ai-images-inside-of-sanity-cms.vtt","encodingFormat":"text/vtt"}}]}}