In learning to automate the process of generating novels, segmenting long texts and then generating shot scripts in response to the segments is an important part of the work.
This method reduces the number of picture images generated, but requires a matching sentence-by-sentence voiceover generation tool. This ensures that the picture and voice are consistent.
A lot of tools to first import the SRT file, in relying on the SRT file in the Chinese version of the time point to generate the screen, so there is noLong text segmentation necessary, just use the text directly to generate audio and SRT for use.
Before for long text segmentation has been using ChatGPT input long text, output CSV format text way. This is not only tired, the output is not too stable, especially when the context is too long. Of course, this approach also has an advantage: it is possible to put theCombine similarly worded text into one paragraphThe
Benefits of using buttons:
- You can add "Text Segmentation" to subsequent workflows to complete the scripting process in one step. (Not explained in this article)
- Code segmentation is more stable and efficient in execution, and invalid characters can be filtered as required.
workflow
1. Create a workflow and add code nodes
2. Enter the code
async function main({ params }: { params: { input: string } }): Promise<{ content: string, rows: string[] }> { // Check if the params and inputs exist const input = params?.input ??? ""; // Split the input text const lines = input.split('\n'); // Store the processed lines const rows: string[] = []; // Process each row for (let i = 0; i 20) { rows.push(line); } else if (line.length > 0) { // If the current line is less than or equal to 20 and not empty, merge into the previous line (if it exists) if (rows.length > 0) { rows[rows.length - 1] += ' ' + line; } else { // If rows is empty (i.e., the first line), add the line directly rows.push(line); } } } // Return the result object return { content: input, // return original input content rows: rows, // returns the processed rows. }; }
Note: Single lines of text will merge and parallelize if they are too short. You can use ChatGPT to add more filtering features, such as filtering special characters.
3. Code node complete configuration
4. Link to end node
5. Create a Bot
6. Select Single Agent Mode
7. Add the workflow published in step 4
8. Copy the output
9. randomly find a JOSN to EXCEL method (search for JSON to EXCEL)
10. Finally: you will get a formatted EXCEL
concluding remarks
In fact, many AI drawing programs have this feature, usually for a fee, but certain programs allow importing full script files to generate images for free.
Subsequent addition of the Generate Screen Cue Words node will result in a more complete screen script EXCEL.
Why don't you make a full workflow? Because the follow-up is unsustainable for fear of paying for it.