{ "name": "GenerateNote", "description": "生成小红书图文笔记", "variables": { "pos": "", "article-prompt": "健康减脂:科学饮食与运动习惯,适合做小红书笔记", "article": "", "img-prompt-json": "", "img-prompt-arr": [], "img-prompt": "" }, "execute": [ { "type": "fun", "method": "remove-folder", "inVars": [ "tmp" ], "outVars": [] }, { "type": "echo", "inVars": [ "开始生成小红书图文笔记" ] }, { "type": "fun", "method": "text2text", "inVars": [ "根据以下主题写一篇小红书风格的图文稿件,要求:长文,至少 500 字,绝对不能超过900字。分段清晰、吸引人、适当使用 emoji、适合发笔记。只输出稿件正文,不要标题。主题:{{article-prompt}}", "" ], "outVars": [ "{article}" ] }, { "type": "fun", "method": "text2text", "inVars": [ "根据:{article}的内容,为配图给出两个图片的 prompt(简短关键词或短语,用于搜图),不要 URL。只输出一行、完整且合法的 JSON 数组且仅包含两个字符串,不要任何说明、换行或 markdown。示例:[\"健康饮食 沙拉\",\"运动 瑜伽\"]" ], "outVars": [ "{img-prompt-json}" ] }, { "type": "fun", "method": "json-to-arr", "inVars": [ "{img-prompt-json}" ], "outVars": [ "{img-prompt-arr}" ] }, { "type": "echo", "inVars": [ "开始下载配图" ] }, { "type": "for", "indexVariable": "{idx}", "array": "{img-prompt-arr}", "body": [ { "type": "echo", "inVars": [ "[配图 {idx}] 尝试按关键词下载 tmp/pic{idx}.png" ] }, { "type": "try", "continueAfterFail": true, "try": [ { "type": "echo", "inVars": [ "[配图 {idx}] download-img:关键词 {img-prompt-arr}[{idx}]" ] }, { "type": "fun", "method": "download-img", "inVars": [ "{img-prompt-arr}[{idx}]", "tmp/pic{idx}.png" ], "outVars": [] } ], "fail": [ { "type": "echo", "inVars": [ "[配图 {idx}] 下载失败,AI 生成备用 prompt" ] }, { "type": "fun", "method": "text2text", "inVars": [ "根据:{article}的内容,为配图给出一个图片的 prompt(简短关键词或短语),不要 URL、不要 JSON、不要引号,只输出一个 prompt。" ], "outVars": [ "{img-prompt}" ] }, { "type": "echo", "inVars": [ "[配图 {idx}] download-img:备用 prompt" ] }, { "type": "fun", "method": "download-img", "inVars": [ "{img-prompt}", "tmp/pic{idx}.png" ], "outVars": [] } ], "success": [] }, { "type": "echo", "inVars": [ "[配图 {idx}] adb:发送图片到设备" ] }, { "type": "fun", "method": "adb-send-img-to-device", "inVars": [ "tmp/pic{idx}.png" ], "outVars": [] } ] }, { "type": "echo", "inVars": [ "步骤:点击添加笔记" ] }, { "type": "fun", "method": "img-center-point-location", "inVars": [ "添加笔记.png" ], "outVars": [ "{pos}" ] }, { "type": "fun", "method": "persist-save", "inVars": [ "add_note_btn_center", "{pos}" ], "outVars": [] }, { "type": "fun", "method": "ocr", "inVars": [ "从相册选择" ], "outVars": [ "{pos}" ] }, { "type": "fun", "method": "adb-click", "inVars": [ "{pos}" ], "outVars": [] }, { "type": "for", "indexVariable": "{idx}", "array": "{img-prompt-arr}", "body": [ { "type": "echo", "inVars": [ "开始选择配图 pic{idx}.png" ] }, { "type": "fun", "method": "img-center-point-location", "inVars": [ "tmp/pic{idx}.png" ], "outVars": [ "{pos}" ] }, { "type": "fun", "method": "adb-click", "inVars": [ "{pos}" ], "outVars": [] }, { "type": "delay", "value": "1s" }, { "type": "fun", "method": "img-center-point-location", "inVars": [ "选中图片.png" ], "outVars": [ "{pos}" ] }, { "type": "echo", "inVars": [ "步骤:点击确认选中" ] }, { "type": "fun", "method": "adb-click", "inVars": [ "{pos}" ], "outVars": [] }, { "type": "delay", "value": "1s" }, { "type": "fun", "method": "adb-keyevent", "inVars": [ "4" ], "outVars": [] }, { "type": "delay", "value": "1s" } ] }, { "type": "fun", "method": "ocr", "inVars": [ "下一步" ], "outVars": [ "{pos}" ] }, { "type": "fun", "method": "adb-click", "inVars": [ "{pos}" ], "outVars": [] }, { "type": "fun", "method": "ocr", "inVars": [ "下一步" ], "outVars": [ "{pos}" ] }, { "type": "fun", "method": "adb-click", "inVars": [ "{pos}" ], "outVars": [] }, { "type": "fun", "method": "adb-input", "inVars": [ "{article}" ], "outVars": [] }, { "type": "fun", "method": "ocr", "inVars": [ "发布" ], "outVars": [ "{pos}" ] }, { "type": "fun", "method": "adb-click", "inVars": [ "{pos}" ], "outVars": [] }, { "type": "echo", "inVars": [ "流程结束" ] } ] }