0:01
[Music] [Music] [Music] [Applause] [Music] [Applause] [Music] [Applause] [Music] so what's new now as you saw in the intro here is I'm going to set up this in two parts so the first is setting it
1:35
up using Drupal using the AI Interpolator so you can have a optimized workflow um and this might be powerful for instance if if you have something like a header image that overlays a colored background or something like
1:51
that and you want to cut out uh whatever is in the foreground and overlay this over the background this is something you could do with this uh uh automatic workflow uh and then after that what I will do is also how to set this up then
2:07
in the Mini Kanban so the Kanban tool that runs automatic AI agents where you can just write what you want to do um I will say also so you know the Mini Kanban at this stage when this video is produced is very experimental so only
2:24
people that really want to you know play around with it can can or should do do this if you want something that's stable you should use it as in the automatic workflow because the Kanban is still extremely experimental
2:40
so with that being said this is extremely easy workflow we just need one module which is the AI Interpolator DreamStudio so this is based on the DreamStudio API that's used for Stable Diffusion but it's also based on a lot of
2:56
um uh it has a lot of extra to tools that you can do around Stable Diffusion and one of this is then removing the background from a image so if you take a image that has a clear foreground maybe a person maybe uh a cat I will show in
3:13
this example it will remove the background and make this transparent so you only get the foreground back so that's what we're going to do I have already uh gotten the code so you can use composer to get the code and all the
3:28
dependencies so I'm just going to start by logging in here on my Drupal website go to extend uh just search for this DreamStudio AI Interpolator DreamStudio install this and then just continue here
3:43
it will also uh then install dependencies which is the base AI Interpolator module then under configuration web services DreamStudio config I just need to log in to DreamStudio and look for the API Keys that's under your profile and then you just
3:59
paste it in here and save uh if you're going to set this up professionally this is not how you should do it you you should work with a settings file or something like that so you can try you know work with continuous integration continuous deployment and stuff like that but this is just for showcasing if
4:15
you're going to try around locally or if you maybe just have a production server or something you can do it like this then I go to structures content type add content type I'm going to add one that I call cutout background
4:30
ground and you know if this was the CMS part of Drupal all this stuff matters what I will do in the future I think I'm going to add an entity type that's only for the automation part so you don't have to uh you know FID around with all
4:47
this stuff because the only thing that's actually important uh when you do the automation is the field API so I just if you don't know Drupal you have to you have to read up about nodes or content types and you will understand what I just did and if you're into Drupal you
5:02
know what I did I'm just going to remove the body field we don't need the body field we're going to reuse because it comes with a image field so we're going to reuse that as the input uh I'm going to set to unlimited because I want to be able to uh upload
5:18
multiple images and get multiple uh cut images back uh then I am just going to create a new field here that we call the background free image and we're going to do file upload image and we're going to
5:34
click continue here this should also be unlimited so if I upload three images you want to also store three new images in this field then so this is always what the AI Interpolator does it takes one field and
5:50
does something with the content from that field and puts that in another field roughly that's not always what it does but roughly that's what it's doing just click enable AI Interpolator here we're going to use DreamStudio remove
6:08
background uh we want the PNG back we take base mode we're going to run uh the base field we're basing this on is image so that's where we're going to upload the images and we're going to get them back in this field then uh in this case we don't chain or do anything that takes
6:23
a long time so I just going to save here uh and that's basically it so if we take content add content cut out background my background images and then I just click browse here I uh just going to choose
6:41
some images there so I chosen three images what's important is these images needs to be uh dividable by 16 in width and height otherwise you're going to get the error message and this this is something that the API requires I might fix in the future so it automatic
7:00
Ally uh fixes the images for this but let's see uh and I'm just clicking save here and that that that's basically how you set it up and now it will hopefully work now and I'm going to get three images
7:13
back then without uh any background so PNG images instead of jpeg images and without uh the floor and the sofa here for instance or without the black back sorry blue background and here uh the
7:28
order happen image without the tapestry in the background and as soon as that is done I will show you how to do the same then uh using the Canan images oh something failed
7:47
there let's just try that again I wonder if I did put this in wrong try one more time that worked better I probably didn't actually paste in the the API key correctly so let's see here
8:30
then um you get the images back I can open this in new tab well it's always going to have a gray background in this case uh but you can see that it's working wait we can do this Photopea is
8:48
a very good website if you don't have Photoshop and I will just show you here so I'm just going to Google a nice background here um let me find something that's big enough okay this was maybe not the
9:11
biggest one but anyway I'm just going to copy him he's a little bit bigger maybe but you can see it's actually working so just rescale him there um so that's it if you uh continue watching I will show you how to set this up in the Kanban board now
9:39
then okay so now I um will show you how to set this up in the Kanban board and just a note here this requires that the first part is set up so the content type has to exist already uh like we set it up or it doesn't have to be a content
9:56
type but the entity type has to exist uh with this workflow and then it's very simple to set up you just go to configuration workflow cine AI settings and administrate AI Interpolator worker agents so this is where you dynamically
10:11
can set up Agents from the AI Interpolator you see I have some set up here I'm just going to click here add AI Interpolator worker agent we just call this uh background remover and then you just have to write
10:26
a short explanation that is good enough for a project manager in this case a AI project manager to understand what this agent can do so it knows how to pick this agent uh and also knows how to pick it in a multi- workflow so that's a thing that this Kanban board can do that
10:47
the uh uh automatic workflows can't do unless you chain them is that it can combine multiple mini agents so if you have a workflow like um you know something like go to the 10 most
11:03
popular website about a search topic put all images into a CSV use those images in the CSV and remove the background from them you could do something like this and this project
11:19
manager understands how to split this up in three different tasks uh no four this different task in this case so do a Google search scrape these websites extract images five it is even produce a CSV uh use the CSV to remove the
11:35
backgrounds right uh and this is what I'm talking about it's still experimental it doesn't work 100% of the time it's it's a a complex thing like that works maybe 50%
11:48
of the time so that's why I don't recommend to use it yet just if you want to try it right but simple workflows like what we're going to set up now if what you saw in the beginning where you you know you just write remove these the
12:04
the background from these three three images that works 100% of the time because that's such a simple thing to understand so anyway we're just going to explain it here then um this agent removes backgrounds from images and
12:20
replaces them with trans trans transpare transparency uh in a PNG file right then you just search for the workflow so we we called it cut out background right you can say how many retries it has uh this depends
12:44
on how complex it is I would say in this case maybe we set uh two because DreamStudio API could have issues for instance um the first time you try something like that right you can say uh
13:02
if this task should go into review or if it should be done when it's done uh when it does it this depends on how complex the workflow is so if you have a really complex workflow where you take a URL and create a a a podcast from it for
13:19
instance that's a very complex workflow where it has to you know go to a URL scrape it write a a a script for the podcast and so on you might want to set it in review when you know check it and then redo it especially if this is going
13:32
to be part of a bigger epic then when where multiple tasks are combined together in this case it's it's a such a simple task that you can assume that if a image has been produced so it it doesn't fail because if it fail it just
13:48
goes back into to do and assigns it back to have created it but you can assume if images got created that they will actually solve it so I'm going to set it to done garbage collect you can set basically if you want to keep the entity that
14:04
generated it this is also much more important when you have complex workflows because if you have a complex workflow where it does five steps for instance you can see that oh it went wrong on the third step or something like that but in our case we don't care we don't want garbage so we just remove
14:20
it right away so it's just going to remove all the logging and history uh of how it generated this we're going to keep it in AED title because we're using content types we have to set the a default value review background content
14:36
but since we're remove with it anyway it doesn't really matter but we we have to set something because it's a required value uh image was the thing that we're inputting so we set this to input and we just write here the image that we want
14:52
to remove background from right and the output then is uh the image after the background got replaced and it's very important then that uh that you set the inputs correctly and the outputs correctly because if that's not said correctly nothing will work you click
15:15
save and that's it now you're now this is available to ask about this so it's not more complex than that so that's it thank you for watching