This workflow uses the AI Interpolator module to take an article text and generate multiple one-sentence image prompts from it using OpenAI GPT-4. The next step is that it uses the service Prompt Perfect to generate even better image prompts for Dall-E 3.
Dall-E 3 then takes these image prompts and generates images for them that we show with the Slick Carousel module as a slider carousel on the article.
This is very useful when you don't have the editorial time to look through stock image databases or take photos yourself, but you still want to visualize the articles with a gallery.
This video is from before the AI Interpolator module became AI Automators, part of the AI module . Module and menu names have changed since, and some steps look different today.
0:01
hey there Marcus here today's workflow is uh a very short one um what I'm going to show is something similar to what I did one time which was creating hitter images for uh article in this case what
0:14
we have here is an article about the uh like the Olympic ceremony in Paris 2024 that's going to be a little bit different they're going to go have it outside of the stadium and go along the
0:27
river Seine instead um and what I want to do here is just create that gallery of images to visualize this uh so like something abstract oil painted maybe uh and I'm
0:40
going to use DALL-E 3 for this so uh that's the thing even with the OpenAI module or OpenAI plugin for AI Interpolator you can generate images as well so it's not just DreamStudio that can do it um and
0:55
I'm going to do it together with the Prompt Perfect module because it does create better prompts for image Generations uh so we're how this is going to work basically we're going to
1:08
first going to ask OpenAI to generate I don't know four Images uh no sorry four image prompts that visualize this article then we're going to take those image prompts that are usually fairly
1:22
okay because OpenAI knows how to do image prompting as well since uh they of course GPT and uh Del is tightly coupled as you can see when you use chat jpt but still what I've seen is if you use prom
1:36
perfect the result is actually more uh visually stunning so we're going to take a second step where we take the Prompt Perfect to perfect these prompts and then we're going to use those prompts
1:50
then again with OpenAI to um generate images using do 3 uh I'm going to show you the Slick Carousel module that we have uh as well that is one of the greatest modules for
2:06
showing a gallery um so this is not written by me of course this is just one one of many many Drupal contributed modules that are awesome uh just to visualize so you don't just see some
2:20
thumbnails but an actual uh like slider Carousel um so I have installed those modules I have set up the API keys I will just show you quickly so if I log in here oh I will say also for you who
2:37
don't know this is Drupal Drupal is open source uh everything is free to use of course using OpenAI using uh cost money Prompt Perfect you get like some testing credits so you can actually test it if
2:50
you want um and but it still cost money right so after you install these modules um there is under the web services there is this Prompt Perfect config where you can add
3:06
the Prompt Perfect API key and OpenAI settings where you can add the OpenAI settings then uh with the Slick Carousel you have to install some libraries and so on but this is very well documented
3:16
in the Slick Aro module I'm not going to show you how to do that so I already prepared that so I'm just going to go through the workflow as it is uh when it comes to the AI Interpolator and all the
3:28
stuff that does B basically um so if we go into our content types we will see it's just a very very simple body right now and that's um once again I can just show you
3:42
the body is then this text that writes about yeah right about the ceremony so what the first thing we want to do here then is uh that we want to take a plane Tes Tes plain long that we call
3:58
the pre- prompt so this is the initial prompt that OpenAI generates from the article we say that we want I'm just going to create four so a real Gallery needs more of course but generating
4:11
images in DALL-E takes time and I don't I don't have video editing software here so I don't want to just sit and be quiet for like a minute or two while it's generating 20 images um
4:24
anyway we want to enable the AI Interpolator because that's what does the magic here and we're going to use OpenAI string long uh we're going to use base mode because the only context that we need is
4:36
the body so the article and then we just write the pr here based on the um based on the context H create four uh one sentence image prompt that visualizes the context of the
5:01
article make them AB make the images abstract and in an oil canvas context of course here um oh so context I'm just going to copy here context and of course here how you prompt this will
5:24
uh be very important for the end result I'm this is something you have to perfect yourself and this is something that has to match your website as well of course what what you're doing I'm
5:35
just giving an example here oil canas is probably not the best example but it gives a very um it gives a very unique view so you can see that it actually follows the
5:47
prompt so I'm going to set on turn on batch mode I will say if you're going to generate 30 40 50 images this will take so long time that even batch mode might time out so the difference between this
6:00
is that direct just means it takes all the AI chaining and just tries to do it in one request batch mode uses JavaScript so it splits them up but then the image generation might actually take
6:13
too long so it might time out uh batch mode is also not good if you're going to programmatically generate the noes so in that case actually the qron U might make
6:24
the most sense I will use the GPT 4 uh turbo in this case so it creates fairly good output I will have the weight 100 this is important you will see now because
6:37
I'm going to add the next step which is once again a text plane long that's going to be the actual image prompt prompt um so we set this to four as well and this also enables AI
6:53
interpolator um and here we're going to use the Prompt Perfect prompt uh the Target Model that we want to do is DALL-E 3 so we basically tell Prompt Perfect that take this prompt
7:06
that OpenAI generated we want to generate the image in DALL-E 3 and generate that even better prompt so I'm just going to take iterations two here you should do a larger number it's going to
7:18
create even better prompts but I would just do the simplest one now and we do pre- prompt uh as the base field so it takes the pre- prompt and generate a better prompt right
7:30
and we say that the interpolator weight is 101 in this case and batch mode so this has to be higher than the last one but because of course the image prompt has to be generated before we can do uh
7:42
sorry the pre- prompt has to be generated before we can do the final image prompt right and the last thing we're going to create here then is a file field that is uh image field and
7:55
this is going to be the actual Gallery where the images are so we call that Gallery uh we do well okay you could set four there I said unlimited then you could basically upload your own images
8:09
after or whatever we don't need alt field in this case we also enable AI Interpolator uh we're going to use OpenAI DALL-E uh to generate images um we're going to use the base
8:24
mode and base it on the image prompts and in this case I will just trust so much that I just write the context from from perfect and this usually gives very good results of course you could add
8:36
very specific uh um Preen prompting or aen prompting to this well where you might say that it should be some specific camera or something right uh and once again batch mode this
8:51
is important that we do interpolator weight that's even higher than creating the image prompt because it needs to create the pre- prompt then the image prompt and then then it can generate
9:00
image I'm going to use DALL-E 3 in this case I just use standard quality I just do the smallest resolution because once again I don't want it to take too long time but if
9:11
you're doing this you should set the highest quality if you need it of course um or actually if I guess the slider looks nicer if it's horizontal so I'm actually going to do the horizontal
9:28
resolution in this case uh before we create this I will just fix the manage display so because we don't want to show The pre- Prompt and the image prompt on the final product and we
9:40
want to show the gallery first without the label and we want this to be a a slick image so this is what the Slick carouso does this has a lot of settings now I'm just going to take uh yeah Flex
9:56
box with the default and image style is none yeah we can do a thumbnail I guess no I don't think slick will actually be using that um I think that's okay I mean you you will have to read
10:15
about exactly what everything does but this should be a okay just lighter at least so I save this and then I go back to my content here and I'm just going to edit it and if I you see there is this
10:30
four pre- prompt Fields there's this four image prompt fields and they are empty uh and the gallery is empty as well right uh so I'm just going to click save now and it's going to start
10:42
processing so this has three basically steps now the initial one is that it generates the initial prompt and that's pretty fast prom perfect is uh it's going to be pretty fast now but as I
10:57
said you should add it ation to it maybe add 10 iterations or something to actually generate as good result as possible so so I will say that right away the the actual result here might
11:10
not be perfect because I'm skipping on the Prompt Perfect um iterations and I'm skipping on the quality of the images as well so you should use HD to get as good
11:26
quality as possible on the images but it's just so to give you an idea and as I said this is open source it's free to use so just feel free to do the exact same setup
11:38
after you watch the tutorial and just um change the configuration there to HD and add iterations to 10 and then as you see even this takes a lot of time but that
11:51
will take even longer time in that case um and of course it's important for you to know if you turn on the cron worker you need to enable your Cron job of course
12:06
as well so there we go so you see we have a gallery here with hopefully four images with very abstract images uh of and you can see it's the river a exactly what the uh article talks about
12:26
right and yeah it this is very abstract so of course how you prompt it matters um but I will just show you here if I go into edit that it has created a pre- prompt here right and then it takes this
12:41
pre- prompt and creates even better image prompts so that's basically wording that works very good with DALL-E 3 right uh so you can see here athletes and perform intermingle in our floating
12:56
stage and here it does a breatht this playay of synchron acrobatics and athletic prowers uh on a stunning leit uh levitating platform to be honest in that case it might overdo it because it's
13:09
supposed to be about normal athlete right but yeah you get the idea you in many cases you can probably skip the Prompt Perfect but it is a very good way of uh making sure especially if you open
13:24
up for editors that might not know prompting uh um that want to use text generation prompt or image prompting to generate better results um and yeah that's it so thank
13:40
you for watching and uh Happy testing this around if you do