Transcript for:
Automating AI Avatar Video Creation

Learn how to build an N8N AI agent that researches viral trending news in your niche and then automatically creates an AI avatar video with a background video behind the avatar so that it's super engaging and then publishes the video to seven social platforms. Everything 100% automated within N8N. Real quick, if you don't know me, my name is Sabrina Romanov. I'm an AI educator with mission to teach 1 million people AI for free. And I've previously built and sold an AI company for millions of dollars. Now, real quick, here's how the avatar looks. My Instagram, here's the background of my dragon behind it. Here it is on my YouTube shorts. Here it is on my Facebook page. Here it is in threads. Here it is on my LinkedIn. Here it is on Twitter. And here it is on. And this is a very highquality avatar made with Hey Jen, an 11labs voice and a faceless background video made in Blot looping behind my avatar just to keep the video visually engaging. I'm going to walk step by step through how to build this. But in the video description, you can just download this template for free. You don't have to join any school community or pay for anything. Let's start at the high level. 1 2 3. What is actually happening here? The first step over here in the yellow brown area is your AI agent researching daily news. In this case, utilizing hacker news and writing a script for the avatar video as well as a video caption. This second block is where we actually create the AI avatar video using Hey Jen's API. And optionally, you can also use your 11 Labs voice, but you don't have to. The third step over here in green handles publishing to Instagram, YouTube, Facebook, threads, LinkedIn, Twitter, and Tik Tok. Let's dive in step by step how it works. Here is just a schedule trigger. Right now, it's set to run once a day at 10:00 a.m. You can change this to run hourly or as often as you want. The second node is an AI agent, a tools agent. It's using Open AI. You can use whatever model you like. In my case, since I'm researching AI related news, I like to use the more technical model 03 Mini. This AI agent has two different tools attached to it. So, one tool retrieves all of the latest front page articles from Hacker News. Okay. Again, you don't have to do anything here, but if you want to customize it, you can change how many articles are returned. You can change the keywords to be searched. In my case, I'm looking for AI news. And you can change where it's searching. Now, this other tool retrieves the article itself as well as the comments related to that article. The reason I enable this is because usually Hacker News is a pretty balanced discussion. It's not just AI hype hype hype. It's more balanced than that. And so, I like to include the comment so that my AI agent has context on like the pros and cons and skepticism around the piece of news. And here's the actual prompt for the AI agent. It's pretty simple. First, it fetches the top 10 stories from Hacker News from the past 24 hours related to AI or LLM. So, that is using the first Hacker News tool to retrieve a bunch of stories. Next, it selects the top story most likely to go viral on social media. And third, it fetches the article itself and the Hacker News comments. That's the second tool that I walk you through. And then, it's going to create a 30-se secondond monologue script for our AI avatar video, roughly following these guidelines. Of course, feel free to tweak this. I try to include lots of details and stats from the article. Sixth grade reading level, so it's not too technical and a balanced viewpoint. The fifth step is optional. Usually, the hook is not super great. So, I want the AI to replace the first two sentences with more sensational hooks that grab a viewer's attention. The third sentence, by the third sentence, however, the script should already start diving into the article's details. And then the last step is to have some kind of CTA. So replace the last sentence with hit follow to stay ahead in AI. And it's important that the AI agent only outputs the exact video script. You don't want any intermediate thoughts or notes or like preamble to the script. You just want the script itself, which we're going to feed into Hen. So once we have that, once we have the video script, next we're going to write a video caption. And I have two processes here. One to write a long form caption for Tik Tok, YouTube, Instagram, Facebook, etc. And then another step writes like a shortened version of the caption for Twitter threads and blue sky which have a character limit. First of all, I feed it in example. This is personally how I like to structure my captions so they're SEO optimized, but obviously feel free to tweak this to your liking. The rough guideline is paragraph summarizing the information followed by three bullet point questions a viewer might ask searching for this news and then the following hashtags at the end. for my AI avatar video. For this one anyway, it's always going to be reporting AI news. So, I just know the hashtags that I want. And you can see an example output here. The hacker news article it actually grabbed is this one. Google is winning on every AI front. You can open this to read the article. And here's the long caption. Google is being discussed to its dominance in AI and its hardware investments as well. And then here you can see the three questions with new lines and the hashtags at the end. Okay. Okay. And then the short caption is just a simple version of that, right? A very short two sentence caption. Sixth grade language balance neutral perspective. Now, this section in red is where we're actually going to create the avatar video. If you haven't already, sign up for Hen. And what you're going to do is create your own avatar. Click create new avatar. Hyperrealistic. Click get started. Click still. I recommend still instead of motion. Let's talk a little bit about how to actually record your avatar video. For me, what works well is using like a selfie stick stand. So, the camera cannot move at all. Hey, Jen will reject your footage if your camera moves or if you stitch multiple clips together. Film it outside in natural sunlight. Uh, you can sit in the shade if the sunlight is too harsh. I just use my iPhone front camera because I want to see where my eyes are looking. It's really important that your eyes are like looking directly at the camera for as long as you can. and speak continuously for 5 minutes. Look directly at the camera. Minimize like external gestures and hand movements and stuff like that. You really want to be as still as possible and try to use jargon specific to your niche. So in AI, I'll say things like LLMs, chat GBT, things that are kind of newer terminology. You want to make sure you're giving the avatar lots of examples of that. Once you do that, you just upload the footage and wait for your avatar to be created. The standard version will use your current background. So, this is a hyperrealistic avatar where I'm sitting outside that's like actually uh just my backyard in the background. However, if you want an avatar where you can replace the background with some other kind of image or video, open the avatar that you just created and then you're going to want to select background removal. And you will have to upgrade your Hey Gen plan, I believe, to enable this feature. And then for voice, I linked mine to my 11 Labs voice, but you can also use the default voice. And I'll show you real quick how to integrate your 11 Labs voice if you have one. Just click here, integrate thirdparty voice. And it's going to ask you for your 11 Labs API key. Once you input it, you'll be able to see your 11 Labs voices here. And you'll know it's from 11 Labs because it says 11 Labs here. Okay? And this is the instant voice clone. So you can do this with a cheaper version of 11 Labs. But if you want the highest quality voice, use the professional voice cloning feature from 11 Labs. It's about $100 per month, and that's the one I favored here. So that's the one I'm using for my avatar videos. Okay. So now to actually integrate HGEN and stuff, go to settings, go to subscriptions and API gen API and then copy your API key. Now let's go back to our program and this setup node is where you're going to fill out your parameters. Open this up. This is where you're going to paste your API key. And then to grab your avatar ID, go to avatars, click on the avatars you've created, and then here, click copy avatar ID. Okay, paste that in. Voice ID is similar. Just go to AI voice and whichever voice you want, click get voice ID. Okay, paste it in here. And then background video URL. So this is an example of a faceless video that I made in Blot. Shout out to House of Dragon if you watch that. And all I do is take the URL from Blot and paste it in here as the background video URL. And this is cool because you can actually make faceless videos related to your content and then automatically have them play behind your avatar. So this is showing roughly how to do that. Once you set up hijen, you don't really need to touch anything else. Everything just uses the values you provided in the previous step. So this will actually call Hey genen to create the avatar video. I'll open up the JSON real quick. So this is information about your avatar. Make sure matting is true if you want to use your avatar with a green screen and that background video. If you don't want to use the green screen, you just want to use a default avatar, just set this to false. Okay. Offset is like where your avatar is positioned. So for my Tik Tok videos, sometimes I like to be in the bottom right corner, which would be 2.2. Here I just put it as the default so you can see what it looks like. For voice here, you can customize these parameters. So speed, pitch, and emotion. These are all optional parameters, but I included them here. So input text is going to be the script that the avatar says. And then voice ID, we previously input in the previous step. Same for video URL here. And there are a lot of different options for how to customize this. So, I do recommend going to the Hunen API, docs.hen.com/reference, then click create avatar video. And you can see all the parameters here, the ones that are optional. You don't have to include. Let's say you want a different background. Let's say instead of a video background, which is what I currently have, you want an image background, right? So, type would be image instead of video. So, change this to image. The URL of the image. So instead of the background video URL, you'd pass in the image URL. And then the fit, the default is cover, but you could crop it, contain it, or do nothing with it. In this in this case, I just left it as a default cover. And since this is a video, you can do things like loop it. But if it's an image, then this parameter doesn't exist. Make sure to just reference the Hen API if you are customizing some of these parameters. And the most important thing here, make sure your dimension is 916 so that it looks good when you publish it to social media. And lastly here, this is the title for your hen video. This is used so that you can find it again within Hey Gen, but you can change this to anything you want. You can see a bunch of my avatars that I was testing this morning and they're all titled the same thing. So you may want to put like a timestamp if that's important to you. Okay, so that's creating the avatar video and then it takes a while to create the video. So I found a 30-se secondond video. I'll usually wait eight minutes or so. Another way to approach this if you're more technical is to have a callback URL where you separate the video creation and end template from the publishing template. But in this example, I just wanted to show the full thing, have everything in one place. Then the last step is to get the avatar video. So this is pretty simple. Again, you don't need to change anything. We're just calling this URL, passing in the video ID and our API key. Okay. And then the output is the video URL like this. Okay. So now we're done with that. We're going to get ready to publish to seven social platforms. So open this up and you're going to want to edit this. You're going to need to pass in your Blot API key and account IDs. You don't need to touch anything here for the final text. For publishing the posts, we are going to use Blotato, which is an app I've built. It's basically an all-in-one content creation tool where you can create content, repurpose content, and distribute dozens of pieces of content per week. And it includes an API so that you can programmatically publish to all the major social platforms. Okay. So once you sign up here, you're going to log into your Blot account. Go to settings on the bottom left. This is where you're going to connect all the social media accounts you want to publish to. On the starter plan, 29 bucks per month, you can connect up to 20 accounts. So, it's quite generous compared to everything else in the market and it includes API access at that price. Okay. Once you've connected your accounts, you'll also want to generate an API key. This is a paid feature, so just be wary of that. When you generate an API key, you will end your free trial and it will start your paid subscription. The reason for that is I just want to reduce like spammers. I want to make sure my third party integration remains in good standing with the social platforms. Okay. So, once you have that, click copy your API key. Put it in here. Boom. And then for each of the accounts, you'll see this accounts ID. So go ahead, copy that. So this is Tik Tok. Paste it in Tik Tok ID, etc. When you connect Facebook, you'll see like a bunch of pages. And then copy the page ID you want and put it here. Uh similarly for LinkedIn, you can post either to a personal profile or a page. If you want to post to a LinkedIn page, you'll need the LinkedIn page ID as well. Okay. So do that for all your social accounts. And then these last two things here are the final video captions. a long version and a short version. So this long version is like I said paragraph, three bullet point questions for SEO optimization and hashtags. The short version is just a two sentence succinct summary of the content. So the long version will go to all of the platforms except Twitter threads blue sky. The short version will go to Twitter threads and blue sky. Okay? And that's all you have to change. You do not have to touch anything else. Then the next step, we're going to upload our avatar video to Blotato first so that there's a stable permanent URL. Again, you don't need to change anything here. All we're doing is sending the video URL to Blot and it's going to upload that media to Blot servers. And then it returns a Blot URL, which is what we're going to use to publish to the social platforms. And again, you don't need to change anything here except prepare for publish. For example, I've opened up in Instagram. Okay, use the API key. And here's the sample JSON request for Instagram. It's pretty simple. So here's the text. It uses the final long text. Target type Instagram platform Instagram. The media URL is the Blot provided URL and then your Instagram account ID. And if you ever have questions on like what parameters you can use, just head over to the Blotato help docs. Help. Scroll down to the API section. This is a quick start, right, with examples. So you can post immediately. You can post at a scheduled time. You can even post threads with multiple posts. And then the API reference. Here is the publish post endpoint which goes into a lot of detail on what you can do and the parameters that are available for each platform. So here for example, Twitter is just target type. LinkedIn has an optional page ID if you want to publish to a company page. For Facebook, page ID is required. Tik Tok has all of these other parameters that you can tweak if you want. But again, to run this entire thing the first time through, you don't need to change anything. I'll open up the Tik Tok one because that one does have a bunch of parameters. Here's the JSON. And you can see there are a bunch of additional parameters. The only one you might want to change if you are posting avatars is is AI generated. It it's up to you. This sometimes Tik Tok does get mad if it figures out you're posting an AI avatar and haven't disclosed it. So text here is the same. Target type, Tik Tok, Tik Tok, etc. Account ID is your Tik Tok account ID. And then what I like to do is test each one at a time. So I'll deactivate for example like all of these and only test Instagram. That's pretty much it for the entire workflow. And again, you're generating really awesome high quality videos like this. I personally would probably move my avatar just a little bit down like bottom right corner so that there's a little bit more visibility of the video playing behind me. And then an advanced step is to burn some captions right above my head here which I'll show in a future video. And so just to recap, first our AI agent is researching hacker news for content related to AI. Then writing a long caption, a short caption, as well as the video script. Then we're using Hey Gen to create the avatar video. And then we're using the Blot API to publish to seven platforms. Now I'm going to recap the only things you need to change to get this running the first time. Okay? You don't want to change too much yet, customize too much yet. You want to make sure everything is running smoothly first and then you can tweak it as needed. And note some of the most common issues here are for the Hunen API, you do need the paid plan. The free plan only gives you 10 credits and you basically consume them when you make one API call. If you're failing at this step, get avatar video, like it's not returning a URL, then that usually means you need to upgrade your API plan for Hey Gen, or you need to increase the wait time. So the longer your script, the longer it takes to create that avatar video. Okay, so to recap, the only two places you need to change are these setup nodes. Setup Hen and prepare for publish. Okay, so setup Hunen again, open it, put your Hen API key, your avatar ID, your voice ID, and a background video URL. For the sake of having an example, I'm going to leave this URL in there. So when you run it the first time, just use this video URL. The second area you have to change is prepare for publish. Like I said, put in your potato API key and accounts IDs. You don't need to touch these two at the bottom here. And that's it. Those are the only two nodes you need to change to get everything running the first time. Obviously, you will need to have some kind of a gen avatar. But if you don't want to make one yet, you can just use one of their pre-built avatars, right? So if I use Brandon, for example, you can just copy that avatar ID for testing purposes. Similarly, for testing purposes, I recommend reducing this time. Instead of a 30- secondond script, just do like a 5-second script. So that way it generates the video really quickly and you can test everything out. When you do that, you can also change the weight amount to like 2 minutes and it should be done. So that just helps speed up your testing and iteration process. And this template will be available for free in the video description, so you can grab it there. If you enjoyed this video, hit like, hit subscribe, drop a comment below if you want me to make more videos like this.