---
title: "Stock Image Finder"
video_id: LjgA5WfuIAo
url: https://www.youtube.com/watch?v=LjgA5WfuIAo
workflow_page: https://workflows-of-ai.com/workflow/stock-image-finder
language: en
captions: generated
---

0:01 hey there Marcus here uh in this video
0:04 I'm going to talk about uh the pixa bay
0:08 module uh in combination with the open
0:11 AI module and how we can generate uh
0:15 basically from this article or there's
0:18 basically some tourist
0:20 information I asked uh chat GPT to
0:23 create for me about perie uh and say now
0:27 that we want to autogenerate an header
0:31 image from stock photos for this this is
0:34 basically what we're going to do and
0:35 we're going to uh use chaining for this
0:37 meaning that we actually need to do this
0:40 in two
0:41 steps
0:43 um
0:45 so this is Drupal if you don't know
0:47 Drupal since before or the AI
0:49 interpolator module in the description
0:53 of the video there's going to be links
0:55 there's also links that
0:57 explains uh what the in AI interpolator
1:00 module isn't um the reasoning why I
1:04 built it basically or why we built it in
1:07 our
1:08 company um everything is open source
1:11 after you looked at this video you can
1:13 download it and just replicate it so
1:16 let's get started we start with login
1:21 in uh so we have a content type now
1:24 called article where we
1:26 have the actual text then now what we
1:30 basically want to do is to search on
1:33 pixabay so pixabay I can show you here
1:37 is uh
1:40 uh stock image database that's actually
1:43 royaltyfree so you're allowed to use
1:45 this so I could of course go in here
1:48 search for an image take that and upload
1:51 that to an image field and so on um but
1:54 we want to automate this because maybe
1:56 we have for some reason we have thousand
1:59 articles and we want to automate this
2:01 could be a could be a reasoning behind
2:03 this
2:04 right so where we start is that we want
2:07 to create a text plane field so just a
2:11 short field where we want to create a
2:12 search word based on the article we call
2:16 this image search
2:20 word just one we don't need many we
2:24 enable the AI interpolator we're going
2:26 to use the open AI string so it takes
2:28 any text and
2:30 users are prompt to rewrite this so
2:32 based on the article So based on
2:35 the
2:37 context
2:39 please write one or two words that can
2:44 be used in a stock photo
2:49 database be used as search words in a
2:54 stock photo
2:55 database use simple words
3:00 so basically shouldn't use very complex
3:03 words because the pixabay search is not
3:06 based on AI so it can't recognize
3:09 complex words it just searches on the
3:11 words that whoever took theault to put
3:13 in
3:15 right context we open the placeholders
3:18 and this is going to be the context
3:21 then uh we just take the rwex we don't
3:24 care about HTML and so on uh we can put
3:27 it in batch so we see the
3:30 progress we put GPT 4 as well we don't
3:33 have to set a role in this case we can
3:35 have moderation
3:37 on
3:39 um but in this uh case we need to create
3:43 another step of course so we need to
3:44 have a image field so an image field
3:47 where we actually put the header image
3:49 we call it in this case because we want
3:51 this image to show up on our website as
3:53 the main image for this article right uh
3:58 we just want one image we're not going
4:00 to set up anything special there we
4:02 disable the alt field for
4:05 now and here we enable the AI
4:09 interpolator uh so the rule we're going
4:11 to use in here is pixabay image
4:14 fature we want to generate one image
4:16 right and we want to base that on the
4:18 image search word and here comes the
4:21 next important step then we're going to
4:23 use the batch it's very important that
4:25 we set a a higher weight than the weight
4:29 of search word getting created because
4:31 of course the search word has to exist
4:33 before the actual uh image search
4:36 happens otherwise there's going to be
4:38 like a race condition in our AI
4:42 chain so and that's it so now we're
4:45 going to go um I will mention you will
4:48 see this in the form and you will see it
4:50 in the view of the article so if you're
4:53 actually setting up a CMS you should of
4:55 course hide the search word the image
4:57 search words makes no sense in this case
5:00 in theory I could also fill out the
5:02 search Word manually here and it would
5:04 use that search word to fill the header
5:06 image then but anyway we save and we
5:09 have the progress bar that will have two
5:11 steps in this case because first we're
5:14 creating the search word and then we're
5:17 using the API service to use the search
5:20 word to download the image then so we
5:24 have a picture outside the Lo uh and it
5:28 used a very simple image search for per
5:31 right um and yeah that's it basically
5:37 it's not more complex than this you can
5:39 automate uh fing your header images
5:42 using
5:43 this um so y thanks for
5:49 watching
