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.
So 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.
So, 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.
But 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.
Um, 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.
Um, 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.
Um, 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 you should make it should make it a lot easier for you to make it work. 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—so I've seen people use things like with iPhone camera setting so it looks more realistic—all of that is possible with this tool.
So yeah, hope you like it. Tell me how you get on. Take care. Bye-bye.