{ "name": "GenerateNote", "description": "生成小红书图文笔记", "variables": { "pos": "", "article-prompt": "健康减脂:科学饮食与运动习惯,适合做小红书笔记", "article": "", "img-prompt-json": "", "img-prompt-arr": [], "img-prompt": "" }, "execute": [ { "type": "echo", "inVars": ["开始生成小红书图文笔记"] }, { "type": "ai", "method": "text2text", "inVars": ["根据以下主题写一篇小红书风格的图文稿件,要求:长文,至少 500 字,分段清晰、吸引人、适当使用 emoji、适合发笔记。只输出稿件正文,不要标题。主题:{{article-prompt}}", ""], "outVars": ["{article}"] }, { "type": "echo", "inVars": ["开始生成小红书配图 prompt"] }, { "type": "ai", "method": "text2text", "inVars": ["根据:{article}的内容,为配图给出两个图片的 prompt(简短关键词或短语,用于搜图),不要 URL。只输出一个 JSON 数组,两个字符串,不要任何说明和 markdown。示例格式:[\"健康饮食 沙拉\",\"运动 瑜伽\"]"], "outVars": ["{img-prompt-json}"] }, { "type": "echo", "inVars": ["{img-prompt-json}"] }, { "type": "json", "method": "json-to-arr", "inVars": ["{img-prompt-json}"], "outVars": ["{img-prompt-arr}"] }, { "type": "echo", "inVars": ["{img-prompt-arr}[0]"] }, { "type": "echo", "inVars": ["开始下载配图"] }, { "type": "for", "indexVariable": "{idx}", "array": "{img-prompt-arr}", "body": [ { "type": "try", "try": [ { "type": "download-img", "inVars": ["{img-prompt-arr}[{idx}]", "tmp/pic{idx}.png"], "outVars": [] } ], "fail": [ { "type": "ai", "method": "text2text", "inVars": ["根据:{article}的内容,为配图给出一个图片的 prompt(简短关键词或短语),不要 URL、不要 JSON、不要引号,只输出一个 prompt。"], "outVars": ["{img-prompt}"] }, { "type": "download-img", "inVars": ["{img-prompt}", "tmp/pic{idx}.png"], "outVars": [] } ] }, { "type": "echo", "inVars": ["pic{idx}.png 下载成功"] }, { "type": "adb", "method": "send-img-to-device", "inVars": ["tmp/pic{idx}.png"], "outVars": [] } ] }, { "type": "echo", "inVars": ["开始添加笔记"] }, { "type": "img-center-point-location", "inVars": ["添加笔记.png", [0.2, 1.6]], "outVars": ["{pos}"] }, { "type": "adb", "method": "click", "inVars": ["{pos}"] }, { "type": "ocr", "inVars": ["从相册选择"], "outVars": ["{pos}"] }, { "type": "adb", "method": "click", "inVars": ["{pos}"] }, { "type": "for", "indexVariable": "{idx}", "array": "{img-prompt-arr}", "body": [ { "type": "echo", "inVars": ["开始先择配图pic{idx}.png"] }, { "type": "img-center-point-location", "inVars": ["tmp/pic{idx}.png", [0.1, 2.0], [0.8, "w"]], "outVars": ["{pos}"] }, { "type": "adb", "method": "click", "inVars": ["{pos}"] }, { "type": "img-center-point-location", "inVars": ["选中图片.png", [0.2, 1.6]], "outVars": ["{pos}"] }, { "type": "adb", "method": "click", "inVars": ["{pos}"] }, { "type": "adb", "method": "keyevent", "inVars": ["4"], "outVars": [] } ] }, { "type": "ocr", "inVars": ["下一步"], "outVars": ["{pos}"] }, { "type": "adb", "method": "click", "inVars": ["{pos}"] }, { "type": "ocr", "inVars": ["下一步"], "outVars": ["{pos}"] }, { "type": "adb", "method": "click", "inVars": ["{pos}"] }, { "type": "adb", "method": "input", "inVars": ["{article}"] }, { "type": "echo", "inVars": ["开始查找并点击发布"] }, { "type": "ocr", "inVars": ["发布"], "outVars": ["{pos}"] }, { "type": "adb", "method": "click", "inVars": ["{pos}"] }, { "type": "echo", "inVars": ["已点击发布"] }, { "type": "echo", "inVars": ["流程结束"] } ] }