process.json 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. {
  2. "name": "GenerateNote",
  3. "description": "生成小红书图文笔记",
  4. "variables": {
  5. "send-btn-pos": "",
  6. "prompt": "健康减脂:科学饮食与运动习惯,适合做小红书笔记",
  7. "img-prompt-arr": [
  8. "健康减脂餐 轻食沙拉 低卡高蛋白 摆盘",
  9. "居家有氧运动 女生健身 燃脂操"
  10. ],
  11. "download-path": "tmp",
  12. "img-url-arr": [],
  13. "idx": 0,
  14. "pos": "",
  15. "thumbRect": ""
  16. },
  17. "execute": [
  18. {
  19. "type": "echo",
  20. "inVars": ["开始生成小红书图文笔记"]
  21. },
  22. {
  23. "type": "ai",
  24. "method": "text2text",
  25. "inVars": ["根据以下主题写一篇小红书风格的图文稿件,要求:长文,至少 500 字,分段清晰、吸引人、适当使用 emoji、适合发笔记。只输出稿件正文,不要标题。主题:{{prompt}}", ""],
  26. "outVars": ["{article}"]
  27. },
  28. {
  29. "type": "save-txt",
  30. "inVars": ["{article}", "tmp/article.txt"],
  31. "outVars": []
  32. },
  33. {
  34. "type": "echo",
  35. "inVars": ["开始生图"]
  36. },
  37. {
  38. "type": "for",
  39. "indexVariable": "{idx}",
  40. "items": "{img-prompt-arr}",
  41. "body": [
  42. {
  43. "type": "echo",
  44. "inVars": ["请根据描述词找一张确认可下载的图片 URL。描述词:{img-prompt-arr}[{idx}]"]
  45. },
  46. {
  47. "type": "try",
  48. "try": [
  49. {
  50. "type": "ai",
  51. "method": "text2text",
  52. "inVars": [
  53. "请根据以下描述词找一张图片,只返回一张确认过可以正常下载的图片 URL(必须是当前可访问、能直接 GET 下载的地址),不要任何说明、markdown 或换行。描述词:{img-prompt-arr}[{idx}]",
  54. "doubao"
  55. ],
  56. "outVars": ["{img-url-arr}"]
  57. },
  58. {
  59. "type": "download",
  60. "inVars": ["{img-url-arr}", "tmp/pic{idx}.png"],
  61. "outVars": []
  62. }
  63. ],
  64. "fail": [
  65. {
  66. "type": "try",
  67. "try": [
  68. {
  69. "type": "ai",
  70. "method": "text2text",
  71. "inVars": [
  72. "请根据描述词找一张图片,只返回一个当前可访问、能直接 GET 下载的图片 URL(不要说明、markdown 或换行)。描述词:{img-prompt-arr}[{idx}]",
  73. "doubao"
  74. ],
  75. "outVars": ["{img-url-arr}"]
  76. },
  77. {
  78. "type": "download",
  79. "inVars": ["{img-url-arr}", "tmp/pic{idx}.png"],
  80. "outVars": []
  81. }
  82. ],
  83. "fail": [
  84. {
  85. "type": "ai",
  86. "method": "text2text",
  87. "inVars": [
  88. "请根据描述词找一张图片,只返回一个可访问的图片 URL(仅 URL,无说明)。描述词:{img-prompt-arr}[{idx}]",
  89. "doubao"
  90. ],
  91. "outVars": ["{img-url-arr}"]
  92. },
  93. {
  94. "type": "download",
  95. "inVars": ["{img-url-arr}", "tmp/pic{idx}.png"],
  96. "outVars": []
  97. }
  98. ]
  99. }
  100. ]
  101. },
  102. {
  103. "type": "echo",
  104. "inVars": ["豆包返回链接原文:", "{img-url-arr}"]
  105. },
  106. {
  107. "type": "echo",
  108. "inVars": ["第{{idx}}张图片下载结束"]
  109. },
  110. {
  111. "type": "adb",
  112. "method": "send-img-to-device",
  113. "inVars": ["tmp/pic{idx}.png"],
  114. "outVars": []
  115. }
  116. ]
  117. },
  118. {
  119. "type": "img-center-point-location",
  120. "inVars": ["添加笔记.png"],
  121. "outVars": ["{send-btn-pos}"]
  122. },
  123. {
  124. "type": "adb",
  125. "method": "click",
  126. "inVars": ["{send-btn-pos}"]
  127. },
  128. {
  129. "type": "img-center-point-location",
  130. "inVars": ["从相册选择.png"],
  131. "outVars": ["{send-btn-pos}"]
  132. },
  133. {
  134. "type": "adb",
  135. "method": "click",
  136. "inVars": ["{send-btn-pos}"]
  137. },
  138. {
  139. "type": "for",
  140. "indexVariable": "{idx}",
  141. "items": "{img-prompt-arr}",
  142. "body": [
  143. {
  144. "type": "echo",
  145. "inVars": ["tmp/pic{idx}.png"]
  146. },
  147. {
  148. "type": "img-center-point-location",
  149. "method": "template",
  150. "inVars": ["tmp/pic{idx}.png"],
  151. "outVars": ["{pos}"]
  152. },
  153. {
  154. "type": "adb",
  155. "method": "click",
  156. "inVars": ["{pos}"]
  157. },
  158. {
  159. "type": "img-center-point-location",
  160. "inVars": ["选中图片.png"],
  161. "outVars": ["{pos}"]
  162. },
  163. {
  164. "type": "adb",
  165. "method": "click",
  166. "inVars": ["{pos}"]
  167. },
  168. {
  169. "type": "adb",
  170. "method": "keyevent",
  171. "inVars": ["4"],
  172. "outVars": []
  173. }
  174. ]
  175. },
  176. {
  177. "type": "echo",
  178. "inVars": ["流程结束"]
  179. }
  180. ]
  181. }