This new AI video model from the TikTok team called sedan's, just dropped a few days ago.
And as you can see, it's already beating Google's V3 and clink two.
What if you could automate the process of generating videos using sedans with this workflow?
Now the clips I'm going to show you in a sec were generated completely automatically using this agents
and automation workflow you are seeing right now.
So let's watch them now.
Vo three has been the top AI video model since Google dropped it a few weeks ago, and people are using
it to blow up on social media.
There are channels that went from zero to tens of thousands of followers in weeks.
Just look at this example.
This account has over 70,000 subscribers and over 2 million views.
Let's watch it quickly.
Now let's watch the clips I generated in two minutes using the workflow.
Now, what's really cool is that Siddons not only generates better quality videos, it can also be 25
times cheaper than Vo3.
So instead of paying $0.75 per second like you would with Vo3, you are looking at maybe $0.03 per second
with Siddons.
All right.
Now I'm going to walk you through how this setup works.
Now, this might look complex at first, but it's actually pretty simple once you understand the flow.
So first of all, you have four main steps.
Generate ideas, produce clips, generate sounds, and connect clips.
So starting here on the left we have our idea generation.
So this runs on a schedule trigger.
So every day or however often you want it kicks off automatically.
We've got two agents working together here.
The first one generates.
The first one generates unique video ideas based on whatever niche you are targeting.
And based on your prompt, it's creating the full concept, writing viral captions with hashtags, describing
the environment where the video should be shot, and even what sounds should go with it.
Because we generate video clips and audio separately, then the second agent takes that idea and breaks
it down into multiple detailed scene prompts.
So from one idea, we are getting like 10 to 13 different scene variations that we can fit to sedans.
Then the second agent takes that idea and break it down into multiple detailed scene prompts.
So from one idea, we are getting like 10 to 13 different variations that we can fit to sedans.
So our AI video generation model now we move into clip production.
So this is where we connect to sedans.
But we are not going directly to ByteDance.
So the team behind the sedans we are using instead we are using wave speed AI, which is essentially
a platform that bundles together hundreds of AI models and gives you access to them through one simple
interface.
So instead of learning how each individual AI model works, you can just use wave speed and access tons
of different models through one service.
They're actually one of the first to implement Sedans Pro, so you can use the model that just returned
V3.
Then we take this scene prompt and sent them one by one to see the answer through Wave Speeds API and
we are using HTTP requests so the system waits for the clips to generate.
Usually it takes about 2 to 3 minutes, then pulls back the video files using another HTTP request node
to get the results.
So from our original idea, we now have multiple short video clips ready to work with.
Since sedans doesn't generate audio, we need to add sounds separately.
For this, we are using full AI with the audio v2 model.
This basically takes each video clip, analyzes what's happening visually, and layers appropriate sound
effects on top.
And the cost for this is really cheap, like a 10th of a cent per second, but it makes a huge difference
in the final quality.
So we connect to full AI to send the video clips and then get back the clips with the added audio.
And finally we stitch everything together, so the system takes all those individual clips with the
their sounds and uses for AI to sequence them into one longer video.
Usually we end up with about 30s of content, and that flows naturally from scene to scene.
Now, throughout this whole process, everything gets logged into Google Sheets so you can track your
ideas, see which video got produced, and have URLs for all your final videos.
If you want to take it further, you can connect this sheet to another automation that posts directly
to TikTok, Instagram, YouTube, or any social media.
The whole thing costs around $0.93 per video, which is incredibly cheap compared to what you would
pay with other models.
You would need to pay over 20 bucks using Vo three for the same output.
So for the 32nd video.
So imagine having a system like this running 24 over seven for you, which uses cadence which is much,
much cheaper than Vo feel free and completely automated.
All right, now let's actually build our workflow from scratch, node by node.
So I'm going to walk you through each step.
And you can follow me to set this up yourself.
So as always we need to add the first step.
So the trigger node to activate our workflow.
So I'm going to use schedule trigger node.
So let's search for schedule trigger.
And I want this workflow to be activated every day at midnight.
I'm going to leave the default configuration as it is.
All right now.
And now let's add our agent which will come up with new ideas for the videos.
So I'm going to add agent.
All right.
Now let's configure this.
For the source for prompt we want to define below.
We also want to require specific output format.
So I'm going to toggle it.
And now I'm going to paste the prompt.
Let's switch over to expression mode.
Expand it and paste it here.
So the prompt is give me an idea about realistic granite rock is being sliced with a sharp knife.
Have your idea be in this format color material shaped like a random object.
Examples for your inspiration.
Glass shaped like a strawberry.
Dry ice shaped like a snowflake and and diamond shaped like a hat, etc..
And we also want to use a tool to review the output You can always go to ChatGPT and explain you an
idea for for your workflow.
For example for video generation workflow and ask for provide some expectations and ask for the prompt.
So I'm going to leave it like that.
Now you want to add system message.
So I'm going to add option system message.
And now I'm going to paste the second prompt.
Again let's switch over to expression.
So this one is quite lengthy.
So let's see.
The role is you are an AI designed to generate one immersive realistic idea based on a user provided
topic.
Your output must be formatted as a JSON array, single line and follow all the rules below.
Exactly.
The rules are only return one idea at a time.
The user will provide a key topic, for example box escaping danger in forest.
The idea must be under 13.
Words must describe a worthy action or moment from the topic.
The caption must be short, punchy and viral friendly.
Include one relevant emoji.
Include exactly 12 hashtags in this order for topic, relevant hashtags for all time most popular hashtags,
and for currently trending hashtags based on live research.
So we want our agent to do research and find the best viral topics we can use to generate our videos.
About all hashtags must be lowercase.
Set status to for production.
Always.
I'm going to show you what is the purpose of this sentence in a sec.
The environment must be under 20 words.
Match the action in the idea.
Exactly.
Clearly describe location, key visuals, background statistic, note macro, cinematic, slow motion,
etc..
Now the sound, because we are going to generate sound separately and then combine them with clips.
So we need to include requirements for sound as well.
So be under 15 words.
Describe the primary sound that makes to happen in this video.
This will be fit to sound model later on.
And for the output format we want to use single line JSON array.
And this is an example.
So caption short viral title with emoji for topic hashtags for all time popular hashtags and for trending
hashtags.
Idea short idea under 13 words environment, stunt and status.
So this prompt will give us a unique idea for our video with a caption that our agent, uh, prepared
for us.
So the core idea and the environment description, uh, a short prompt for the sand and also the production
status so we can track the process of generating videos, uh, in our Google sheet.
In other words, the system prompt defines the agent's role and provides rules to make sure the output
will be as you want.
So you can read through this and tweak it if you like.
So the user prompt is relatively simple.
It's just a command to give us an idea about the specific niche we are trying to to replicate.
Now let's add our chat model.
I'm going to use GPT four.
Make sure your OpenAI account is connected and let's switch to GPT four.
I don't recommend using GPT four because it struggles with splitting scenes for video clips and giving
the proper output.
I will show you what I mean later.
So let's let's use GPT four.
All.
Right.
Great.
Now we don't need memory for the tool.
Let's use think tool.
All right.
And let's leave the tool description as default.
Now the next note is a simple Google Sheet.
Note.
Because we want to save ideas generated by the agent into spreadsheet.
So let's add Google sheet node.
We want to append row in sheet.
Now let's rename this node save idea.
Make sure you are connected to the correct account for the resource.
We have sheet within document for the operation we want to add up and row.
And now I'm going to share with you the sheet template.
So once you save it you will be able to retrieve it here.
So this is the Google sheet we are going to use for this workflow.
We have a few columns ID idea which is generated by our first agent caption production.
You have for production you have done and skip environment prompt, command prompt and final output
which will be populated automatically.
So it will be the link to the final video.
So once you download it from the resource section and save it, you can use it here from list.
Going to see that in a ten Hit one.
And once you select this Google Sheet, it will automatically give you all the columns.
So you have ID, idea, caption, production environment, prompt, sound prompt, and final output.
This Google sheet looks generations, so when this workflow creates the final video the automation will
mark this row.
So production.
So right here as done.
So this Google sheet will be automatically populated.
And you also get the link to the final video.
So you can share it on social media or just download it.
Now each of those columns we are mapping based on what our ideas agent Uh, provided us.
So now let's actually rename this agent to.
Idea.
Generator.
Agent.
Perfect.
Now let's close it.
Save.
And now let's test it to generate ideas so we can map all the values.
To execute workflow.
Let's wait a moment.
Alright, we got some error.
But don't worry, it was expected.
As you can see, at least one value has to be added on the values to send.
So now.
Now as you can see we have an output, but we have all values just within this one object.
So we need to split these values to match them to the columns.
So we are going to use a node.
So let's add another node.
So output parser.
Because we want to return data in a JSON format.
All right.
Now we want to.
Now we need to provide an example of a JSON format from this output.
We want to get.
So I'm going to paste it here.
Going to remove this and paste it here.
So we want our output to be splitted to separate Eight key values.
Show caption.
Idea.
Environment.
Sounds and status.
And now.
Save.
Now let's test the workflow again to execute workflow.
All right.
Now as you can see we have a nice JSON format so we can map the values.
So let's leave it for now for the idea.
Let's grab it and drop it here.
Now caption.
So we are going to pass dynamic variables because the text is green.
Production is from idea generator.
A note included in the output.
Now for production we have status.
For environment prompts.
You have an environment.
And for for some prompt you have sound.
The last one will be populated automatically because this is the final video.
So yes, now each column is properly mapped except for the final output where we will store the final
video.
Once the workflow generates it.
So the ID uses an Excel formula by design.
So when this node runs, the Excel formula gets stored and translates to an ID for our tracking.
So the different values that our idea that our ideas agent will create.
Alright great.
So let's add this formula.
So it's an equal sign.
Row.
Double brackets minus one.
Now when you check the Google sheet and click on any ID, you can see that this is a formula by default.
So you can just copy it.
And paste it right here.
All right.
Great.
Now this note is done.
Let's move on.
Now you can proceed with our second agent.
So this agent will turn those ideas into multiple prompts to then generate three different scenes.
Because we want to generate three separate clips and then stitch them together into one final video.
So let's add an agent.
Now for the source.
For prompt we want to define below.
I'm going to pace the prompt.
So give me three video prompts based on the previous idea.
Use the text tool to review your output.
All right.
Great.
So this is our prompt writer.
So let's rename it.
To.
Prompt writer agent.
And you also require specific output format.
Now let's add system message.
Such that expression expanded I'm going to paste the prompt.
So the role is you are a prompt generation AI specializing in cinematic ASMR style video prompts.
And your task is to generate a multi-scene video sequence that vividly shows a sharp knife actively
cutting through a specific object in a clean, high detail setting.
So your writing must follow this style.
Sharp, precise cinematic realism.
Macro level detail with tight focus on the blade interacting with the object.
The knife must always be in motion, slicing, splitting, or gliding through the material.
Never idly or static.
Camera terms are allowed.
Macro view tight angle over the blade shot, and each scene must contain all of the following expressed
through detailed visual language.
The main object or subject from the idea.
The cutting environment or surface from the environment.
So as you can see from our previous note, idea and environment, the texture, structure and behavior
of the material as as it's being cut, a visible sharp blade actively cutting, and descriptions should
show the physical makeup of the material, how the material responds respond to the blade.
The interaction between the blade and the surface.
The tone.
Clinical.
Visual.
No poetic metaphors, emotion or storytelling.
Avoid fantasy or surreal imagery.
All descriptions must feel physically grounded and logically accurate.
And length.
Each scene must be between 1000 and 2000 characters.
No shallow or repetitive scenes.
Each must be immersive, descriptive and specific.
Is scene should explore a distinct phase of the cutting process.
A different camera perspective or a new behavior of the material under the blade.
And now for the.
From the inputs we want to pass the values from the previous node.
So idea.
So you can simply just remove it and take idea from here.
The symphonic environment and sound.
So here we define the format we want to achieve.
And since.
So that's why we we want to toggle required specific output format.
Alright great.
So as you can see this prompt is very detailed.
You can tweak it.
You can modify it to to your needs depending on what videos you want to generate.
This prompt was prepared specifically for the demo you watched at the beginning of this lesson.
Now let's start our chat model.
So actually we are going to use the same GPT photo.
So just let's connect it to this node.
We don't need memory.
For the tool we want to use node as well.
So let's connect it.
Well, I.
Perfect.
Now for this agent.
We also want to use a structured output parser.
So let's add it.
Because we want to define a specific JSON format.
So how the output from our agent should look like.
So I'm going to paste the JSON example here.
So you have idea environment sand C1, C2 and C3.
Because as I mentioned we want to generate three separate scenes and then stitch them together into
one final video.
All right.
Perfect.
Now let's actually save and test this workflow.
Let's wait a moment.
Let's check.
Now, as you can see, we have nicely formatted output.
If idea environment SAT and three separate scenes.
So the idea is actually gray granite shaped like a donut.
All right.
You have a prompt for our sound.
So sharp slicing sound with Rocky crunch the environment.
You have a close up of sharp knife slicing through ground in workshop lighting.
And for the scene, for the first scene, we have the camera zooms in.
For the second scene we have a close up tight angle captures the right and over the blade shot highlights.
Okay, perfect.
Now let's check our Google Sheet.
As you can see, one more idea has been added.
We have ID, we have a gray granite shaped like a donut.
So this is the new one.
You have all the values stored in our Google sheet.
So just to clarify.
Scene one, scene two and scene three are all different variations of that one idea.
So we can have different iterations when we pass that along to sedans.
So the prompts are kind of similar to our first agent.
So we have a user prompt which is very simple.
Asking for free video prompts based on the previous idea we guide, we guided On what should do, and
we provide instructions around agents, rules and role.
So how the prompt should look like.
All right.
So now we've got our free prompts ready.
And we need to actually generate the video clips.
So the first thing we need to do might look a bit technical but stick with me.
It's a pretty straightforward.
Right now our free prompts are bundled together as one package in N810, so we need to separate them
so we can work with each one individually.
So we need to add a code node and paste the simple code snippet in JavaScript.
So I'm going to paste the code node.
So basically this is our scene extractor.
So I'm going to rename this node.
This extractor.
So we need to unpack our prompts so sedans can process each scene separately.
So that's what this node does.
So I know that sounds intimidating, but you don't need to write any of this yourself.
You can ask ChatGPT to create this script for you.
Also, if you want to understand what's exactly this code is doing, you can copy and paste it into
ChatGPT and ask it to explain every line.
So the important thing is that after this step you have three.
We have three separate items instead of just one package.
So now.
Just to demonstrate it to you when I pin data.
And execute this node.
I can see that I got three items.
When I open it.
Go to table.
So here on the left in the input you can see that, uh, we already have three separate scenes.
So C1, C2 and C3.
And each one is its own field inside a single item.
But in n810, that still counts as just one item.
As one JSON object.
What we need is to turn each scene into its own item, so we can send them one at a time to dance.
So that's why we added this code node.
And that's what this code snippet does.
So it simply pulls out those three scene descriptions and splits them into separate items.
As you can see on the right side in the output.
All right.
Perfect.
Now we can move on to the actual video generation part.
So we are going to use HTTP request node.
HTTP request.
Select this node.
Now for the method.
We want to send a request.
So let's change the let's switch the method to post.
Because we are going to send a request to see dance.
Asking to create our video.
Video clips.
But we are not going directly to see dance.
As I mentioned in the demo.
Instead we are using a service called Wave Spy.
We are going to use this service because they integrated a lot of different AI models into one platform,
and instead of figuring out how to connect up some of the models and using different AI services, we
can just learn how to use AI and we can get access to all of the models.
And they were actually the first to implement Sedans Pro, which is the version that outperformed Google's
V3.
So we are specifically Using there.
So basically the host, a lot of powerful AI models the text to video, image to video and so on.
And you can make API calls to those models.
And they offer good prices compared to the competition on the market.
I guess they are one of the best currently.
So create your account.
Now once you create your account and sign in, let's search for the model you want to use.
So you're going to use ByteDance.
So the team behind the the creators of TikTok see does V1 Pro text to video 480.
So let's select it.
Now as you can see ByteDance sedans 1.0 is the new generation model, outperforming Cliq two with ultra
fast generation and so on.
Now here you have playground.
You can play with it.
You can give it some prompts and check the check if you like the output.
Now your request will cost $0.15.
So for $1 you can run this model approximately six times.
So we are going to check the documentation.
So select API.
And here you will find all the details you need to set this up.
So this is the URL we need.
So let's copy it.
As you can see the request should be post method.
Let's paste the URL here.
All right.
Great.
Now, as you can see, we want to use header for the content type.
You have application slash JSON authorization bearer and the API key.
So basically if you don't know how to use HTTP request node and make API calls to some services, you
can always go to the documentation of a specific service and find out how to set up the connection.
So now let's go back to our workflow.
Let's switch authentication to generic credential type.
We want to use header authentication.
We want to send body.
We want to switch body content type to row.
As you can see.
Data row.
For the content type.
We have application JSON.
Now for the body let's switch over to expression mode and let's expand it.
And I'm going to paste the body parameter.
So here we specify the aspect ratio duration.
As you can see in the documentation the duration you have a prompt.
For the prompt.
We want to pass video team.
So from our prompt writer agent.
So from this node.
We want to pass idea.
So basically I can do it right now.
So we just want to grab this value and paste it here.
For the for explaining to our credence model what happens in the video?
What should happen in the video.
We want to pass JSON description.
And this comes from the scenes extractor.
So the previous node.
So the same as always.
Just need to drag and drop it here.
And the environment.
So where the video is shot we want to pass environment variable from the output from our prompt writer
agent which described for us the environment.
All right.
Great.
And that's it.
Now as you can see all these three variables are dynamic because they are green and here we can see
the result.
So the actual description, the actual idea and environment description of the environment here.
So the prompt is dynamic which means it automatically pulls in the team the detailed action from our
agent and the environment description.
And since we are processing three different prompts you can click through and see what we are actually
sending.
So three separate requests to a wave speed AI platform.
Here.
One.
Two three.
Perfect.
Now that's not batching.
So let's add option batching.
Items per batch, so let's set it to one.
So basically what this means is input will be split in batches to throttle requests.
So we sent one prompt at a time with a short three second pause between each one.
So let's change it to 3000.
3000 milliseconds.
All right.
Great save.
Let's test our workflow to see if everything works properly.
All right.
Great.
It's all green.
That's a good sign.
Let's open it.
So as you can see, the status code is 200, Which means in the API language that everything worked
perfectly.
And you have three success messages.
And that's because I already set up my credentials.
Now it's your turn.
So go to Header Authentication.
Click on this little pen.
And here we need to provide API keys.
So let's go back to documentation.
As you can see authorization is better and API key.
So we need to type exactly as it is.
So switch over to expression mode.
Expand it.
Remove it.
Type better.
Now go to Wave Speed AI platform.
Go to API keys.
And in order to use this service, you need to top up your account.
And here you can buy credits so you can enter a specific amount for example $2 or buy packages for ten,
50 or $100.
Remember, the cost of each API request is $0.15.
I spent $12 to top up my account and I also got $20 as a gift.
Actually, I don't know why.
Maybe.
Maybe if you buy a $10 package you will get a recharge from admin, but I'm not sure.
Once you top up your account, you can.
Once you top up your account, you can go to API keys.
And create a create key.
Please enter a key name so it does.
Create key.
Now you can copy it.
Go back to your workflow.
Paste it right here.
And then close it.
It's safe and perfect.
Now when you test the workflow you should get success message.
All right.
Brilliant.
The key thing to understand is that at this point, we successfully requested our video clips, but
sedans is still working on creating them.
That's why our next step will be to wait for the generation to complete.
So let's add wait node.
Let's wait for 300 seconds.
Yes.
So here we have to be patient.
Just a quick note.
In the HTTP request node.
Make sure that.
The name is spelled correctly.
So authorization with capital A and for the value also.
Better.
So you have you need to make sure that you get the capitalization right and include the space after
better.
And after that paste your API keys from wave speed.
Otherwise it won't work.
Safe.
And actually now let's rename this node to.
Create clips.
Now let's add another HTTP request node.
But this time to get clips.
So search for HTTP request.
So we are using get method instead of post.
And now we're asking wave speed I to give us the finished clips.
So let's go back to our documentation.
So the model we are using is called.
Let me check.
All right.
It will be quicker.
So again API.
And here we have instruction how to get our clips.
So let's copy this URL.
As you can see request get get method.
Let's go to our Get Clips node.
Let's rename it get Clips method get URL.
Now you have to replace this.
But first let's configure this node.
So we want to Authenticate it by generic credential type.
Generic authentication type will be header.
And you have to do exactly the same thing.
So let's check the documentation.
The header we have authorization beta.
So this is correct.
Now let's add our API key.
So switch over to expression expand it.
Type beta.
Followed by space.
I need to grab my API keys.
And paste it here.
All right.
Great.
Safe.
Now let's run our workflow so we can get the value.
All right.
So let's click Save and execute workflow.
Oh actually it's starting from the beginning.
All right.
All right, let's wait a moment.
Actually we have to wait a couple of minutes because I specified here 300 seconds to give our agent
to give our model the time to generate clips.
Now, let's move on.
We got three items.
Store three video clips generated by create clips node.
So by sedans by the sedans model.
So let's open it.
We got an error.
This is because we have to specify the request ID.
That's why we wanted to test the first, to now be able to pass the ID from the root node.
Of course, you can always type it, but I wanted to make it easy for you.
So just simply remove this part.
And grab the ID from here.
Actually first let's switch over to expression.
All right.
And now it should work perfectly fine.
Perfect.
So the next step is to generate sounds.
So we can put an audio layer on the clips we got from sedans.
So let's hit save.
Now let's add another HTTP request node.
So search for HTTP.
All right.
Now we want to switch method to post.
And the service the platform we are going to use to generate sounds is called Fallai.
So go to philly.com.
Create your account and sign in.
So it's kind of similar to wave speed I.
And now when you test it again.
So let's pin the data.
And execute this node.
You can see that we get three outputs.
So each containing an mp4 URL.
You can actually you can actually copy this URL and paste it to your browser to see the result.
So it will download the video clip for you to preview.
Let's see.
All right.
Awesome.
All right.
Now that we have our video clips generated, the next steps are optional.
But they are really complete the workflow.
So we are going to add sound effects and then stitch everything together into one longer video.
So for the sound generation we are using another HTTP request node.
And we are posting a request to create sound effects for our clips.
Now the platform we are going to use is kind of similar to a wave speed I.
It's called fallai.
So just go to Philly.com and create an account and sign in.
Tuesday services.
So to make API calls to the models they host, you also need to, uh, top up your account.
But, um, the API calls are very cheap.
So as you can see, I've spent $10 and generated like 30 videos.
And so far I have only used $0.30.
So the model we are using is called model V2.
So once you top up your account.
Just simply type and then audio v2.
So it's the video to video model.
Now we are going to use documentation to figure out how to set up the HTTP request node.
So switch to the API tab.
Then the table of content have to choose http curl.
Then scroll down.
And here we can check how to submit a request.
So the client API handles the API submit protocol.
All right.
So yeah we have request post URL.
So let's copy this URL.
Let's go back to our workflow.
Let's paste the URL right here.
Let's just rename this node to create Sans for the authentication.
Let's choose generic credential type.
We also have.
Of.
Sorry.
We also have a header.
So for authorization we have a instead of better we have a key.
So let's copy on authorization.
Let's select header authentication.
We don't want to use wave speed AI service for this node because we want to generate sounds not video
clips.
So let's provide credentials we have authorization.
Now value expression expand it.
And type capital key followed by space.
Go to your account.
Go to home API keys.
Add key.
Name it.
Remember to keep it safe because it works like a password.
So create key.
Now you can copy it.
Copy key.
And paste it here.
Perfect.
It's safe.
Now I want to send body.
We want to switch body content type to row.
All right.
Now you have video URL and prompt.
We can also expand it.
For the content type.
We have application JSON.
And now let's create our body.
So I'm going to switch over to expression expand it.
And I'm going to paste the body right here.
So the body looks like that as in our documentation we have a prompt and video URL.
So for the prompt I've got ASMR is soothing sound effects.
The prompt our prompt writer agent prepared for us.
So you can simply just go to Prompt Writer agent.
And.
Simply drop it here.
Duration and video URL from our Get Clips node within the output object.
Perfect.
So basically it looks exactly the same as in the documentation because we have a prompt and video URL,
but we also added duration.
As you can see the prompt and URL.
Awesome.
Now let's hit save.
Let's also add batching.
So.
I'm going to add batching.
Items per batch one and 2000.
All right.
Great.
Now let's add another weight node.
So let's wait.
Let's wait about 60s for our model to generate sounds for us.
And now let's get those generated sounds.
So another HTTP request node.
We get sounds method get.
Now let's copy our URL.
Now let's grab the URL from the documentation.
Pass it here.
Let's add.
Okay.
Forward.
Slash.
Request.
Forward slash.
And here you have to pass a request ID from the previous node from the.
So from the wait node after we run this workflow and get it and get it from file I.
So let's hit save.
And now let's actually create songs.
So let's pin the data.
And let's execute this node.
So now we're gonna wait 60s.
All right.
We got an error.
Let's fix it.
Some method not allowed.
Please check you are using the right HTTP method.
Item zero.
So now we are able to grab this request id and drop it here.
Let's switch over to expression.
Perfect.
Now authentication.
Generic.
Credential type.
Question.
Authorization.
Expression.
Okay.
And let's grab our API key.
I'm going to create a new one.
And paste it here.
And remember, it has to be exactly like that.
So.
Key followed by our API key.
Oh, actually, I didn't copy it.
Copy key.
Okay, copy.
All right, let's fix it like that.
Save.
And let's execute it again.
Now we got an error.
Aha!
Because I have to choose my credentials here.
Perfect.
Let's try again.
All right.
I know what's wrong.
The request is still in the queue.
So basically, the sons are not yet are not ready yet.
So the I.
So the API can send us the result.
So to fix it, we just need to wait a bit longer or check the status first.
Now let's actually restart the workflow.
Let's wait a few minutes.
Now the new idea has been added to our Google sheet.
All right.
So we have three new clips.
The message is success.
All right.
Now let's wait a few minutes.
Yes.
So basically there are two ways to avoid getting this error in the future.
You can increase the waiting time, for example, to.
100 80s to give.
More time to for generating the sense for us.
Or another way is to add another HTTP request node.
Before we getting the sense.
To check the status.
So you can use the get method to get the status from the AI platform by placing this URL field, and
then we can use if node to add additional logic.
So if the status is completed only then move to the next step.
And then you would need to.
And here you would need to specify the value.
So this is our status.
So JSON dot status is equal to.
Completed.
But we are going to stick with the simpler method to not make it more complex.
I wanted to demonstrate to you how you can fix waiting times errors for the future.
I'm going to delete these notes.
And let's try it for our sons.
Also, I did a test and I realized that I missed a closing bracket in the body in the Create Scripts
node.
So right here.
So it's really important to double check that you don't miss, for example, any bracket when you compare
the format to the format provided in the documentation.
So in that case with the documentation on the fly platform, it's a good practice to double check the
format to the format provided in the documentation of any API and any service.
Perfect.
Now when I open the Jetsons node.
I can see that I've got three items here as the output.
So that's great.
And now the important part is that we are passing the description from our original prompt agent, the
ten second duration.
And most importantly, the video URL from our previous seasons generation.
So since we are processing three clips, an audio model will add the sounds to each one.
That's why we have three items here.
And when this runs you will see the requests are in the queue.
And audio model starts working on adding sounds to our clips.
That's why we add another node here for 60s.
But I increase the time to 100 and 80s to give a model time to process everything.
And then we have another Get request to retrieve our clips.
Now, with sand layers added.
And each of our three items now contains a video with sound effects.
Now you can copy this URLs and and preview them in your browser, and you should hear the sound effects
on top of our original clips.
Just a quick note regarding the audio model.
The best part about this model is it costs only about 0.001 per second, which is basically a 10th of
a cent.
So it's a very economical for what you get.
All right.
Now that we successfully have three clips with sounds, we need to connect to stitch them together into
one final video.
So let's add another node.
This time node.
Node.
And what we are going to do here.
We are going to take this three separate mp4 files and group them into one item.
So we need them bundled together for the stitching process.
So I'm going to paste a short piece of code.
So this code takes our individual video URLs and packages them together.
Now when you execute this step.
You can see that we had three separate items.
And now we have all these videos combined into one item.
And now we are going to add another HTTP request node.
This one will be for stitching our videos together using ffmpeg.
Through file I.
FFmpeg is a video editing service that lets us do automatic video editing.
Luckily, Pal-i has an integration with FFmpeg which makes it really easy to use.
So the cost is very cheap.
As you can see.
It's about 0.0002 per compute second.
So let's set this up.
First let's actually rename this node to video.
You are a collector.
And now let's add another HTTP request node Not to start the stitching process.
So http.
Now we want to use post method.
And to get the URL from Falaise documentation.
So just search for the book.
It's this one compose.
So we did a video model.
Selected.
Then go to API.
And here you can grab the URL and you get the URL from Falaise documentation.
Authorization stays the same as before.
So generic credential type header authentication.
We want to send the body.
Use raw type for the content type application slash JSON.
And for the request body we need to add custom instructions.
So I'm going to switch over to expression.
Now this comes directly from file documentation on how they use ffmpeg.
So what we are doing here is we are listing our clips one by one, providing timestamps and duration
for each, and telling the ffmpeg to stitch them together into one video.
And now when we run this node, the request goes into queue.
So let's add another node.
And let's wait for 60s.
To let the model stitch our videos together.
Now let's rename our HTTP request node.
To sequence.
Video.
I forgot about batching, so let's add batching.
Items for batch one.
Batch interval thousand.
Let's hit save.
And now we need one more get request to retrieve our final video.
Now, before you give it a test to get the request ID for the next step, make sure you are selecting
the correct credentials in the authentication.
So make sure you are using the credentials for connecting to our AI service, not the AI platform.
All right, now we need one more Get request to retrieve our final video.
So let's add another HTTP request node.
Let's switch method to post.
I'm going to paste the URL from documentation.
Let me switch over to schema.
You can grab the request ID from the right node and just drop it here.
All right.
So we are using the API URL with the specific request ID that they gave us from the previous step.
So we can track which video is ours.
And when this process completes we get our final video URL.
So just let's add authentication again.
Add the.
Whole I.
Like that.
Now let's execute this step.
So we got our final video URL And you can copy it and paste it into a browser.
It downloads our complete 32nd video with all clips properly stitched together and all the sounds included.
All right.
Great.
Now we have our final video ready.
So the final step is to properly log that URL in our Google Sheet node.
So let's add actually first let's rename this node to get final video.
So now let's add one more Google Sheet node.
And we want to.
Update the sheet.
Make sure you are connected to the correct account.
Let's select our sedans sheet sheet1.
The column to match all we want to select idea.
So this connects to the same document we have been using.
And what it does is find the specific row we need to update in our Google sheet.
Remember that row we created at the beginning with our idea?
We are going to find that exact row and mark the production column as done right.
And most importantly, we are logging our final video URL into this Google sheet.
So you have a proper tracking of where to find this video.
And now let's grab the idea from the Safe Idea node.
And drop it into this field.
So we are using the safe idea from the.
From this node.
And now we need to replace the item.
With first.
And run brackets.
Because when nodes run in different branches of our workflow and it can't automatically match which
data belongs to together.
Yes.
So we want to tell anything to just to grab the first item from that node.
All right.
So now we have a dynamic variable here.
Perfect.
Now let's execute the step.
All right.
And now let's check our Google sheet.
Awesome.
All right.
Great.
We are done.
And if we set this workflow to run every day.
By using this scheduled trigger, it will create videos for us automatically and log them into this
Google sheet one by one.
And now you can either publish this yourself, or you can expand this system.
To take it a step further, you can connect this Google sheet to.
You can post these videos on social media platforms such as TikTok, Instagram Reels, YouTube shorts.
Now to conclude to create 32nd video using CD-Rs and this automation, it was only about $0.09.
Compare that to Vo3, which would have cost us about $20.
So that's the massive difference.
And adding the Suns is also very cheap.
Only $0.03 for the final video.
And then stitching the clips together is less than a cent.
So in total we are looking at $0.93 to create a complete 32nd video automatically.
So that's pretty incredible.
All right, I hope you learned something new in this tutorial.
Remember you can download the template from the resources section of this lesson.
When you are building this solution from scratch and face any issues or get any errors.
You can compare your configurations to the pre-made template and always you can ask questions in the
Q&A section.
Thank you for bearing with me and see you in the next one.