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[] }> { // 检查 params 和 input 是否存在 const input = params?.input ?? ""; // 分割输入文本 const lines = input.split('\n'); // 存储处理后的行 const rows: string[] = []; // 处理每一行 for (let i = 0; i < lines.length; i++) { const line = lines[i].trim(); // 如果行长度大于20,直接加入结果中 if (line && line.length > 20) { rows.push(line); } else if (line.length > 0) { // 如果当前行长度小于等于20且非空,合并到前一行(如果存在) if (rows.length > 0) { rows[rows.length - 1] += ' ' + line; } else { // 如果 rows 为空(即第一行),直接添加该行 rows.push(line); } } } // 返回结果对象 return { content: input, // 返回原始输入内容 rows: 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.