[{"data":1,"prerenderedAt":430},["ShallowReactive",2],{"footer-primary":3,"footer-secondary":93,"footer-description":119,"ai-ai-image-generation":121,"ai-ai-image-generation-next":165,"sales-reps":178},{"items":4},[5,29,49,69],{"id":6,"title":7,"url":8,"page":8,"children":9},"522e608a-77b0-4333-820d-d4f44be2ade1","Solutions",null,[10,15,20,25],{"id":11,"title":12,"url":8,"page":13},"fcafe85a-a798-4710-9e7a-776fe413aae5","Headless CMS",{"permalink":14},"/solutions/headless-cms",{"id":16,"title":17,"url":8,"page":18},"79972923-93cf-4777-9e32-5c9b0315fc10","Backend-as-a-Service",{"permalink":19},"/solutions/backend-as-a-service",{"id":21,"title":22,"url":8,"page":23},"0fa8d0c1-7b64-4f6f-939d-d7fdb99fc407","Product Information",{"permalink":24},"/solutions/product-information-management",{"id":26,"title":27,"url":28,"page":8},"63946d54-6052-4780-8ff4-91f5a9931dcc","100+ Things to Build","https://directus.io/blog/100-tools-apps-and-platforms-you-can-build-with-directus",{"id":30,"title":31,"url":8,"page":8,"children":32},"8ab4f9b1-f3e2-44d6-919b-011d91fe072f","Resources",[33,37,41,45],{"id":34,"title":35,"url":36,"page":8},"f951fb84-8777-4b84-9e91-996fe9d25483","Documentation","https://docs.directus.io",{"id":38,"title":39,"url":40,"page":8},"366febc7-a538-4c08-a326-e6204957f1e3","Guides","https://docs.directus.io/guides/",{"id":42,"title":43,"url":44,"page":8},"aeb9128e-1c5f-417f-863c-2449416433cd","Community","https://directus.chat",{"id":46,"title":47,"url":48,"page":8},"da1c2ed8-0a77-49b0-a903-49c56cb07de5","Release Notes","https://github.com/directus/directus/releases",{"id":50,"title":51,"url":8,"page":8,"children":52},"d61fae8c-7502-494a-822f-19ecff3d0256","Support",[53,57,61,65],{"id":54,"title":55,"url":56,"page":8},"8c43c781-7ebd-475f-a931-747e293c0a88","Issue Tracker","https://github.com/directus/directus/issues",{"id":58,"title":59,"url":60,"page":8},"d77bb78e-cf7b-4e01-932a-514414ba49d3","Feature Requests","https://github.com/directus/directus/discussions?discussions_q=is:open+sort:top",{"id":62,"title":63,"url":64,"page":8},"4346be2b-2c53-476e-b53b-becacec626a6","Community Chat","https://discord.com/channels/725371605378924594/741317677397704757",{"id":66,"title":67,"url":68,"page":8},"26c115d2-49f7-4edc-935e-d37d427fb89d","Cloud Dashboard","https://directus.cloud",{"id":70,"title":71,"url":8,"page":8,"children":72},"49141403-4f20-44ac-8453-25ace1265812","Organization",[73,78,84,88],{"id":74,"title":75,"url":76,"page":77},"1f36ea92-8a5e-47c8-914c-9822a8b9538a","About","/about",{"permalink":76},{"id":79,"title":80,"url":81,"page":82},"b84bf525-5471-4b14-a93c-225f6c386005","Careers","#",{"permalink":83},"/careers",{"id":85,"title":86,"url":87,"page":8},"86aabc3a-433d-434b-9efa-ad1d34be0a34","Brand Assets","https://drive.google.com/drive/folders/1lBOTba4RaA5ikqOn8Ewo4RYzD0XcymG9?usp=sharing",{"id":89,"title":90,"url":8,"page":91},"8d2fa1e3-198e-4405-81e1-2ceb858bc237","Contact",{"permalink":92},"/contact",{"items":94},[95,101,107,113],{"id":96,"title":97,"url":8,"page":98,"children":100},"8a1b7bfa-429d-4ffc-a650-2a5fdcf356da","Cloud Policies",{"permalink":99},"/cloud-policies",[],{"id":102,"title":103,"url":81,"page":104,"children":106},"bea848ef-828f-4306-8017-6b00ec5d4a0c","License",{"permalink":105},"/bsl",[],{"id":108,"title":109,"url":81,"page":110,"children":112},"4e914f47-4bee-42b7-b445-3119ee4196ef","Terms",{"permalink":111},"/terms",[],{"id":114,"title":115,"url":81,"page":116,"children":118},"ea69eda6-d317-4981-8421-fcabb1826bfd","Privacy",{"permalink":117},"/privacy",[],{"description":120},"\u003Cp>A composable backend to build your Headless CMS, BaaS, and more.&nbsp;\u003C/p>",{"id":122,"slug":123,"vimeo_id":124,"description":125,"tile":126,"length":127,"resources":8,"people":8,"episode_number":127,"published":128,"title":129,"video_transcript_html":130,"video_transcript_text":131,"content":8,"status":132,"episode_people":133,"recommendations":145,"season":146,"seo":164},"d948815e-2417-4319-814b-87d7c5fbdd43","ai-image-generation","945761480","Generate new images within Directus Automate with this custom operation, powered by OpenAI.","ad0578de-c6af-432b-aa4d-6749ee367e0e",4,"2024-05-16","AI Image Generation","\u003Cp>Speaker 0: The Directus AI image generation operation will take in a prompt and a couple of other settings and use OpenAI's DALL E 3 model to generate an image, which you can then save into your director's project. So here we have a recipes collection and an item with a recipe that I wrote and there is an empty field here for an image. Because I'm actually not a good chef we're gonna use AI to generate an image which we can then use on things like social media or the recipe website header, things like that. So, we are going to create a new flow, and we'll call this one generate image, and we'll make this a manual flow trigger on the recipes collection. So a button appears on the right.\u003C/p>\n\u003Cp>Now we are gonna manually give it a prompt because we don't have an amount of text suitable to send for an image generation, only a big recipe that's too long. So without a single field here, I'll just call it prompt. You might choose to call it something nicer, and we'll just make it a little text input here. Now that had a key of prompt, and what that means is whenever that button is pressed, we will receive the ID of the item where we press the button and also the prompt itself. And so we are gonna use that prompt and send it off for image generation.\u003C/p>\n\u003Cp>So we will go ahead and create a new operation here, and we will use the AI image generation operation. Now we need to use our open AI API key, we'll pop that in here and our prompt. And once again this is gonna be dynamic so trigger dot body dot prompt. We want high quality, standard quality will do, and we'll make it square so we can share it on our Instagram grid. So we'll hit save.\u003C/p>\n\u003Cp>This will result in having, a URL. So we now need to import that URL into our directors project. To do that, we will use the request URL operation, and we'll make a post request to this Directus project URL slash files slash import. Just a note that I've made image, file creation body, we are going to set the URL to the value that was returned from the last operation, which is just a URL string. So that will import the image to our file library.\u003C/p>\n\u003Cp>The final step is that we want to save that image into into the actual item where we triggered the flow to begin. So we're gonna add one final operation here, which is to update data. We are going to update the recipe specifically trigger dot body dot keys 0 which is the ID. And we are going to update the file value. File, and that is going to be last dot data dot data dot ID because that is a response for an API call.\u003C/p>\n\u003Cp>And that should be it. You should be able to press the button. It will come up with a box for the prompt. It will go and generate the image, import it, and save it back to the image. So let's try that out.\u003C/p>\n\u003Cp>Let's go in here. Let's generate image. I've got this rudimentary prompt written, and we'll run Flow on current item. Now image generation takes a little while so we'll come back when it's done. We're back and it did not work because it is not called file, it is called image.\u003C/p>\n\u003Cp>So we're gonna update that and we'll go back and run it again. Welcome back, and it turns out I'm not a very good engineer because that is not an easy stuffed bell pepper. It is a bowl stuffed with bell peppers. But in any case, you need to write better prompts but that is how you use the Directus AI image generation operation. I'll see you in the next video.\u003C/p>","The Director's AI image generation operation will take in a prompt and a couple of other settings and use OpenAI's DALL E 3 model to generate an image, which you can then save into your director's project. So here we have a recipes collection and an item with a recipe that I wrote and there is an empty field here for an image. Because I'm actually not a good chef we're gonna use AI to generate an image which we can then use on things like social media or the recipe website header, things like that. So, we are going to create a new flow, and we'll call this one generate image, and we'll make this a manual flow trigger on the recipes collection. So a button appears on the right. Now we are gonna manually give it a prompt because we don't have an amount of text suitable to send for an image generation, only a big recipe that's too long. So without a single field here, I'll just call it prompt. You might choose to call it something nicer, and we'll just make it a little text input here. Now that had a key of prompt, and what that means is whenever that button is pressed, we will receive the ID of the item where we press the button and also the prompt itself. And so we are gonna use that prompt and send it off for image generation. So we will go ahead and create a new operation here, and we will use the AI image generation operation. Now we need to use our open AI API key, we'll pop that in here and our prompt. And once again this is gonna be dynamic so trigger dot body dot prompt. We want high quality, standard quality will do, and we'll make it square so we can share it on our Instagram grid. So we'll hit save. This will result in having, a URL. So we now need to import that URL into our directors project. To do that, we will use the request URL operation, and we'll make a post request to this Directus project URL slash files slash import. Just a note that I've made image, file creation body, we are going to set the URL to the value that was returned from the last operation, which is just a URL string. So that will import the image to our file library. The final step is that we want to save that image into into the actual item where we triggered the flow to begin. So we're gonna add one final operation here, which is to update data. We are going to update the recipe specifically trigger dot body dot keys 0 which is the ID. And we are going to update the file value. File, and that is going to be last dot data dot data dot ID because that is a response for an API call. And that should be it. You should be able to press the button. It will come up with a box for the prompt. It will go and generate the image, import it, and save it back to the image. So let's try that out. Let's go in here. Let's generate image. I've got this rudimentary prompt written, and we'll run Flow on current item. Now image generation takes a little while so we'll come back when it's done. We're back and it did not work because it is not called file, it is called image. So we're gonna update that and we'll go back and run it again. Welcome back, and it turns out I'm not a very good engineer because that is not an easy stuffed bell pepper. It is a bowl stuffed with bell peppers. But in any case, you need to write better prompts but that is how you use the Directus AI image generation operation. I'll see you in the next video.","published",[134],{"people_id":135},{"id":136,"first_name":137,"last_name":138,"avatar":139,"bio":140,"links":141},"82b3f7e5-637b-4890-93b2-378b497d5dc6","Kevin","Lewis","a662f91b-1ee9-4277-8c9d-3ac1878e44ad","Director of Developer Experience at Directus",[142],{"url":143,"service":144},"https://directus.io/team/kevin-lewis","website",[],{"id":147,"number":148,"year":149,"episodes":150,"show":161},"25c1b8ec-a696-4551-8d13-4e2abfbc7cb5",1,"2024",[151,152,153,122,154,155,156,157,158,159,160],"6aee5cdc-3d0a-4fa6-acee-49c1860a553d","50b4447b-73c7-4b49-9e70-d210595d1a7e","42784fad-29d4-4f01-a076-43f1817655b7","2d94463a-5c39-4274-ba39-287e9059cc9c","afb17dd7-48b9-4297-ada8-f22c1daa82ce","be92a983-6a6a-411f-8f07-2cba4aa9308c","afc8f09e-f82f-473d-8643-14176380ae52","3d978332-855b-4eb0-a878-b932e0f9d704","40e14c84-7b60-4fc2-a125-beec15e39a28","be07b8cd-0d0f-4713-affe-88c210c29d9a",{"title":162,"tile":163},"Directus AI","b3609dd7-2fea-4925-ae4a-8a4a69a1b64b",{"title":8,"meta_description":8},{"id":154,"slug":166,"season":147,"vimeo_id":167,"description":168,"tile":169,"length":127,"resources":8,"people":8,"episode_number":170,"published":128,"title":171,"video_transcript_html":172,"video_transcript_text":173,"content":8,"seo":174,"status":132,"episode_people":175,"recommendations":177},"ai-image-moderation","945761757","Analyze images for drugs, suggestive or explicit material with this custom operation, powered by Clarifai.","314fcef8-4c7e-41ac-a7ab-96838c6f0aff",5,"AI Image Moderation","\u003Cp>Speaker 0: The Directus AI image moderation operation helps you build safer and more positive applications powered by Clarify. It will take in an image and tell you whether there is any drugs, suggestive or explicit material, or gore in the images, and then you can take action based on what is right for your application. So we're gonna build that together today. So we are going to create a new flow that will trigger whenever a new image is uploaded. We'll call this moderation, image moderation.\u003C/p>\u003Cp>Lovely, and we will run this whenever a file is uploaded. Now this will run on every file that's uploaded regardless of type. So in the real, you will want to add a condition that checks that this is indeed an image or perhaps based on a certain folder maybe just end user upload folders stuff like that. The documentation for this operation shows you how to set that up, but for now, I'm going to assume every file is an image and every file wants this moderation check. So we have this file upload, and we are gonna go ahead and use our AI image moderation.\u003C/p>\u003Cp>There it is. AI image moderation operation. Now we want to provide our Clarify API token and provide a full file URL. So https tunnel.orws.i0 /asset/trigger.key which is the ID of the file whose upload started this flow, and of course you'll want to replace this with your actual, Director's project URL. There's also a threshold here, which will change which items are flagged.\u003C/p>\u003Cp>So you will always get back a raw response between 0 and a100 of the confidence that either drug drugs suggestive or explicit material or gore is present, but there's an additional section called flags, which makes it easier to take action. This threshold changes what is needed for something to appear as a flag. In fact, I just want to show you how this works because what happens next is very very specific. So, I've got an image here of a needle with some white powder. So, sorry in our file module here we'll just go and update upload that.\u003C/p>\u003Cp>So you see that's the image there, there is definitely some drugs in that image right. So we're gonna go over to our flow and and we're gonna look at the log, and we see here that in the payload, there's a very very very high chance that drugs were present. It's not suggestive. It's not gore. It's not explicit, and because that number is above our threshold this appears as a flag.\u003C/p>\u003Cp>Now in most episodes in this series, I build a complete project, but this one is really up to you. You might choose instead of an action, which is a non blocking flow, you may choose to block it, and if and then you add a condition on to the end of the moderation, and if there's something that's flagged, you may stop it being uploaded at all, or you may flag it a certain way, change a status on the file field and stop it displaying to end users or display a warning. You may choose to email moderators to come in and do a manual check over. You may wanna send an email to the user and so on and so forth. So, hopefully, you can start seeing the applications of this image moderation operation.\u003C/p>\u003Cp>I'm gonna stop here in this video because it gets very specific after this, very implementation specific. But I hope you find loads of value in it. It's really, really powerful, and hopefully, you'll agree quite nice to set up. So I'll see you in the next video. Bye for now.\u003C/p>","The Directus AI image moderation operation helps you build safer and more positive applications powered by Clarify. It will take in an image and tell you whether there is any drugs, suggestive or explicit material, or gore in the images, and then you can take action based on what is right for your application. So we're gonna build that together today. So we are going to create a new flow that will trigger whenever a new image is uploaded. We'll call this moderation, image moderation. Lovely, and we will run this whenever a file is uploaded. Now this will run on every file that's uploaded regardless of type. So in the real, you will want to add a condition that checks that this is indeed an image or perhaps based on a certain folder maybe just end user upload folders stuff like that. The documentation for this operation shows you how to set that up, but for now, I'm going to assume every file is an image and every file wants this moderation check. So we have this file upload, and we are gonna go ahead and use our AI image moderation. There it is. AI image moderation operation. Now we want to provide our Clarify API token and provide a full file URL. So https tunnel.orws.i0 /asset/trigger.key which is the ID of the file whose upload started this flow, and of course you'll want to replace this with your actual, Director's project URL. There's also a threshold here, which will change which items are flagged. So you will always get back a raw response between 0 and a100 of the confidence that either drug drugs suggestive or explicit material or gore is present, but there's an additional section called flags, which makes it easier to take action. This threshold changes what is needed for something to appear as a flag. In fact, I just want to show you how this works because what happens next is very very specific. So, I've got an image here of a needle with some white powder. So, sorry in our file module here we'll just go and update upload that. So you see that's the image there, there is definitely some drugs in that image right. So we're gonna go over to our flow and and we're gonna look at the log, and we see here that in the payload, there's a very very very high chance that drugs were present. It's not suggestive. It's not gore. It's not explicit, and because that number is above our threshold this appears as a flag. Now in most episodes in this series, I build a complete project, but this one is really up to you. You might choose instead of an action, which is a non blocking flow, you may choose to block it, and if and then you add a condition on to the end of the moderation, and if there's something that's flagged, you may stop it being uploaded at all, or you may flag it a certain way, change a status on the file field and stop it displaying to end users or display a warning. You may choose to email moderators to come in and do a manual check over. You may wanna send an email to the user and so on and so forth. So, hopefully, you can start seeing the applications of this image moderation operation. I'm gonna stop here in this video because it gets very specific after this, very implementation specific. But I hope you find loads of value in it. It's really, really powerful, and hopefully, you'll agree quite nice to set up. So I'll see you in the next video. Bye for now.","5030a562-a906-4869-a63c-1a3678a20bfe",[176],"0eade7f9-5a3c-49c1-9e15-13d9f16a0bfd",[],{"reps":179},[180,236],{"name":181,"sdr":8,"link":182,"countries":183,"states":185},"John Daniels","https://meet.directus.io/meetings/john2144/john-contact-form-meeting",[184],"United States",[186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235],"Michigan","Indiana","Ohio","West Virginia","Kentucky","Virginia","Tennessee","North Carolina","South Carolina","Georgia","Florida","Alabama","Mississippi","New York","MI","IN","OH","WV","KY","VA","TN","NC","SC","GA","FL","AL","MS","NY","Connecticut","CT","Delaware","DE","Maine","ME","Maryland","MD","Massachusetts","MA","New Hampshire","NH","New Jersey","NJ","Pennsylvania","PA","Rhode Island","RI","Vermont","VT","Washington DC","DC",{"name":237,"link":238,"countries":239},"Michelle Riber","https://meetings.hubspot.com/mriber",[240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,384,385,386,387,388,389,390,391,392,393,394,395,396,397,398,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,424,425,426,427,217,428,429],"Albania","ALB","Algeria","DZA","Andorra","AND","Angola","AGO","Austria","AUT","Belgium","BEL","Benin","BEN","Bosnia and Herzegovina","BIH","Botswana","BWA","Bulgaria","BGR","Burkina Faso","BFA","Burundi","BDI","Cameroon","CMR","Cape Verde","CPV","Central African Republic","CAF","Chad","TCD","Comoros","COM","Côte d'Ivoire","CIV","Croatia","HRV","Czech Republic","CZE","Democratic Republic of Congo","COD","Denmark","DNK","Djibouti","DJI","Egypt","EGY","Equatorial Guinea","GNQ","Eritrea","ERI","Estonia","EST","Eswatini","SWZ","Ethiopia","ETH","Finland","FIN","France","FRA","Gabon","GAB","Gambia","GMB","Ghana","GHA","Greece","GRC","Guinea","GIN","Guinea-Bissau","GNB","Hungary","HUN","Iceland","ISL","Ireland","IRL","Italy","ITA","Kenya","KEN","Latvia","LVA","Lesotho","LSO","Liberia","LBR","Libya","LBY","Liechtenstein","LIE","Lithuania","LTU","Luxembourg","LUX","Madagascar","MDG","Malawi","MWI","Mali","MLI","Malta","MLT","Mauritania","MRT","Mauritius","MUS","Moldova","MDA","Monaco","MCO","Montenegro","MNE","Morocco","MAR","Mozambique","MOZ","Namibia","NAM","Niger","NER","Nigeria","NGA","North Macedonia","MKD","Norway","NOR","Poland","POL","Portugal","PRT","Republic of Congo","COG","Romania","ROU","Rwanda","RWA","San Marino","SMR","São Tomé and Príncipe","STP","Senegal","SEN","Serbia","SRB","Seychelles","SYC","Sierra Leone","SLE","Slovakia","SVK","Slovenia","SVN","Somalia","SOM","South Africa","ZAF","South Sudan","SSD","Spain","ESP","Sudan","SDN","Sweden","SWE","Tanzania","TZA","Togo","TGO","Tunisia","TUN","Uganda","UGA","United Kingdom","GBR","Vatican City","VAT","Zambia","ZMB","Zimbabwe","ZWE","UK","Germany","Netherlands","Switzerland","CH","NL",1773850438667]