| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562 |
- {
- "name": "GenerateNote",
- "description": "生成小红书图文笔记",
- "variables": {
- "add_note_img_center_pos": "",
- "pic_thumb_img_center_pos": "",
- "select_pic_img_center_pos": "",
- "ocr_pos_pick_from_album": "",
- "ocr_pos_next_1": "",
- "ocr_pos_next_2": "",
- "ocr_pos_publish": "",
- "article-prompt": "健康减脂:科学饮食与运动习惯,适合做小红书笔记",
- "article": "",
- "img-prompt-json": "",
- "img-prompt-arr": [],
- "img-prompt": ""
- },
- "execute": [
- {
- "type": "fun",
- "method": "remove-folder",
- "inVars": [
- "tmp"
- ],
- "outVars": []
- },
- {
- "type": "fun",
- "method": "persist-read",
- "inVars": [
- "add_note_img_center_pos"
- ],
- "outVars": [
- "{add_note_img_center_pos}"
- ]
- },
- {
- "type": "fun",
- "method": "persist-read",
- "inVars": [
- "ocr_pos_pick_from_album"
- ],
- "outVars": [
- "{ocr_pos_pick_from_album}"
- ]
- },
- {
- "type": "fun",
- "method": "persist-read",
- "inVars": [
- "select_pic_img_center_pos"
- ],
- "outVars": [
- "{select_pic_img_center_pos}"
- ]
- },
- {
- "type": "fun",
- "method": "persist-read",
- "inVars": [
- "ocr_pos_next_1"
- ],
- "outVars": [
- "{ocr_pos_next_1}"
- ]
- },
- {
- "type": "fun",
- "method": "persist-read",
- "inVars": [
- "ocr_pos_next_2"
- ],
- "outVars": [
- "{ocr_pos_next_2}"
- ]
- },
- {
- "type": "fun",
- "method": "persist-read",
- "inVars": [
- "ocr_pos_publish"
- ],
- "outVars": [
- "{ocr_pos_publish}"
- ]
- },
- {
- "type": "echo",
- "inVars": [
- "开始生成小红书图文笔记"
- ]
- },
- {
- "type": "fun",
- "method": "text2text",
- "inVars": [
- "根据以下主题写一篇小红书风格的图文稿件,要求:长文,至少 500 字,绝对不能超过900字。分段清晰、吸引人、适当使用 emoji、适合发笔记。只输出稿件正文,不要标题。主题:{{article-prompt}}",
- ""
- ],
- "outVars": [
- "{article}"
- ]
- },
- {
- "type": "fun",
- "method": "text2text",
- "inVars": [
- "根据:{article}的内容,为配图给出两个搜图用关键词(短语即可)。严格只输出一行 JSON 数组,元素恰好 2 个字符串,除此之外不要任何字符。规则:只用英文半角双引号 \" 包裹每个元素,元素内不要用双引号;不要用中文引号「」或 “”;不要 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": "if",
- "condition": "{add_note_img_center_pos} == ''",
- "then": [
- {
- "type": "echo",
- "inVars": [
- "步骤:无缓存,ai计算图片中心点"
- ]
- },
- {
- "type": "fun",
- "method": "img-center-point-location",
- "inVars": [
- "添加笔记.png"
- ],
- "outVars": [
- "{add_note_img_center_pos}"
- ]
- },
- {
- "type": "fun",
- "method": "persist-save",
- "inVars": [
- "add_note_img_center_pos",
- "{add_note_img_center_pos}"
- ],
- "outVars": []
- }
- ],
- "else": []
- },
- {
- "type": "fun",
- "method": "adb-click",
- "inVars": [
- "{add_note_img_center_pos}"
- ],
- "outVars": []
- },
- {
- "type": "if",
- "condition": "{ocr_pos_pick_from_album} == ''",
- "then": [
- {
- "type": "echo",
- "inVars": [
- "步骤:无缓存,OCR 识别「从相册选择」"
- ]
- },
- {
- "type": "fun",
- "method": "ocr",
- "inVars": [
- "从相册选择"
- ],
- "outVars": [
- "{ocr_pos_pick_from_album}"
- ]
- },
- {
- "type": "fun",
- "method": "persist-save",
- "inVars": [
- "ocr_pos_pick_from_album",
- "{ocr_pos_pick_from_album}"
- ],
- "outVars": []
- }
- ],
- "else": []
- },
- {
- "type": "fun",
- "method": "adb-click",
- "inVars": [
- "{ocr_pos_pick_from_album}"
- ],
- "outVars": []
- },
- {
- "type": "for",
- "indexVariable": "{idx}",
- "array": "{img-prompt-arr}",
- "body": [
- {
- "type": "fun",
- "method": "persist-read",
- "inVars": [
- "img_center_tmp_pic_{idx}"
- ],
- "outVars": [
- "{pic_thumb_img_center_pos}"
- ]
- },
- {
- "type": "echo",
- "inVars": [
- "开始选择配图 pic{idx}.png"
- ]
- },
- {
- "type": "if",
- "condition": "{pic_thumb_img_center_pos} == ''",
- "then": [
- {
- "type": "echo",
- "inVars": [
- "[配图 {idx}] 无缓存,识图计算缩略图中心"
- ]
- },
- {
- "type": "fun",
- "method": "img-center-point-location",
- "inVars": [
- "tmp/pic{idx}.png"
- ],
- "outVars": [
- "{pic_thumb_img_center_pos}"
- ]
- },
- {
- "type": "fun",
- "method": "persist-save",
- "inVars": [
- "img_center_tmp_pic_{idx}",
- "{pic_thumb_img_center_pos}"
- ],
- "outVars": []
- }
- ],
- "else": []
- },
- {
- "type": "fun",
- "method": "adb-click",
- "inVars": [
- "{pic_thumb_img_center_pos}"
- ],
- "outVars": []
- },
- {
- "type": "delay",
- "value": "1s"
- },
- {
- "type": "if",
- "condition": "{select_pic_img_center_pos} == ''",
- "then": [
- {
- "type": "echo",
- "inVars": [
- "[配图 {idx}] 无缓存,识图计算「选中图片」中心"
- ]
- },
- {
- "type": "fun",
- "method": "img-center-point-location",
- "inVars": [
- "选中图片.png"
- ],
- "outVars": [
- "{select_pic_img_center_pos}"
- ]
- },
- {
- "type": "fun",
- "method": "persist-save",
- "inVars": [
- "select_pic_img_center_pos",
- "{select_pic_img_center_pos}"
- ],
- "outVars": []
- }
- ],
- "else": []
- },
- {
- "type": "echo",
- "inVars": [
- "步骤:点击确认选中"
- ]
- },
- {
- "type": "fun",
- "method": "adb-click",
- "inVars": [
- "{select_pic_img_center_pos}"
- ],
- "outVars": []
- },
- {
- "type": "delay",
- "value": "1s"
- },
- {
- "type": "fun",
- "method": "adb-keyevent",
- "inVars": [
- "4"
- ],
- "outVars": []
- },
- {
- "type": "delay",
- "value": "1s"
- }
- ]
- },
- {
- "type": "if",
- "condition": "{ocr_pos_next_1} == ''",
- "then": [
- {
- "type": "echo",
- "inVars": [
- "步骤:无缓存,OCR 识别「下一步」(1)"
- ]
- },
- {
- "type": "fun",
- "method": "ocr",
- "inVars": [
- "下一步"
- ],
- "outVars": [
- "{ocr_pos_next_1}"
- ]
- },
- {
- "type": "fun",
- "method": "persist-save",
- "inVars": [
- "ocr_pos_next_1",
- "{ocr_pos_next_1}"
- ],
- "outVars": []
- }
- ],
- "else": []
- },
- {
- "type": "fun",
- "method": "adb-click",
- "inVars": [
- "{ocr_pos_next_1}"
- ],
- "outVars": []
- },
- {
- "type": "if",
- "condition": "{ocr_pos_next_2} == ''",
- "then": [
- {
- "type": "echo",
- "inVars": [
- "步骤:无缓存,OCR 识别「下一步」(2)"
- ]
- },
- {
- "type": "fun",
- "method": "ocr",
- "inVars": [
- "下一步"
- ],
- "outVars": [
- "{ocr_pos_next_2}"
- ]
- },
- {
- "type": "fun",
- "method": "persist-save",
- "inVars": [
- "ocr_pos_next_2",
- "{ocr_pos_next_2}"
- ],
- "outVars": []
- }
- ],
- "else": []
- },
- {
- "type": "fun",
- "method": "adb-click",
- "inVars": [
- "{ocr_pos_next_2}"
- ],
- "outVars": []
- },
- {
- "type": "fun",
- "method": "adb-input",
- "inVars": [
- "{article}"
- ],
- "outVars": []
- },
- {
- "type": "if",
- "condition": "{ocr_pos_publish} == ''",
- "then": [
- {
- "type": "echo",
- "inVars": [
- "步骤:无缓存,OCR 识别「发布」"
- ]
- },
- {
- "type": "fun",
- "method": "ocr",
- "inVars": [
- "发布"
- ],
- "outVars": [
- "{ocr_pos_publish}"
- ]
- },
- {
- "type": "fun",
- "method": "persist-save",
- "inVars": [
- "ocr_pos_publish",
- "{ocr_pos_publish}"
- ],
- "outVars": []
- }
- ],
- "else": []
- },
- {
- "type": "fun",
- "method": "adb-click",
- "inVars": [
- "{ocr_pos_publish}"
- ],
- "outVars": []
- },
- {
- "type": "echo",
- "inVars": [
- "流程结束"
- ]
- }
- ]
- }
|