n8n Workflow Example: Fetching Local Images and Generating Videos
n8n Workflow: Example of Fetching Local Images to Generate VideosI. First, select the trigger method for the first node, select retrieving files from local disk for the second node, select the API request to generate video for the third node, and query the generated video for the fourth node.II. Click into the file reading configuration
1.
Select the first option to fetch images from local storage;
2.
The second item is the file path. Note that the backslash "" copied from disk needs to be converted to: "/";
III. Click into the first request Set the method according to the request method required by the API you need to use. The url is the API request address. For the authentication type, select the second option.![image.apidog.com/api/v1/projects/5443236/resources/606572/image-preview)Select Bearer Auth for authorization.Add a new entry and fill in the token. This authorization can be used for all HTTP requests.If the above authorization doesn't work, open Send Headers. In the Name field, enter: Authorization. In the Value field, enter: Bearer+token (with one space between Bearer and the token).
2.
Open Send Body and pass the corresponding parameters according to the documentation. Select Form Data for the parameter passing type.
3.
Passing the image is a special case here. The left side is the local image we retrieved from the previous node. When passing the image, select n8n Binary File to retrieve the content on the left. In the value field, fill in data, which represents the entire image on the left.
IV. Open the fourth node
1.
All other configurations are the same as above, but since this is a query interface, you need to check where the id is located. If the format is https://xxxx:xxxx/xxxx/{id}, where the id is at the end of the interface, you need to place the id retrieved from the previous node's interface into this position. You can either enter it manually or click on the Tid identifier in the red circle on the left and drag it to the end of the interface, as shown in the figure.