process.json 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  1. {
  2. "name": "GenerateNote",
  3. "description": "生成小红书图文笔记",
  4. "variables":
  5. {
  6. "pos": "",
  7. "article-prompt": "健康减脂:科学饮食与运动习惯,适合做小红书笔记",
  8. "article": "",
  9. "img-prompt-json": "",
  10. "img-prompt-arr": [],
  11. "img-prompt": ""
  12. },
  13. "execute": [
  14. {
  15. "type": "echo",
  16. "inVars": ["开始生成小红书图文笔记"]
  17. },
  18. {
  19. "type": "ai",
  20. "method": "text2text",
  21. "inVars": ["根据以下主题写一篇小红书风格的图文稿件,要求:长文,至少 500 字,分段清晰、吸引人、适当使用 emoji、适合发笔记。只输出稿件正文,不要标题。主题:{{article-prompt}}", ""],
  22. "outVars": ["{article}"]
  23. },
  24. {
  25. "type": "echo",
  26. "inVars": ["开始生成小红书配图 prompt"]
  27. },
  28. {
  29. "type": "ai",
  30. "method": "text2text",
  31. "inVars": ["根据:{article}的内容,为配图给出两个图片的 prompt(简短关键词或短语,用于搜图),不要 URL。只输出一个 JSON 数组,两个字符串,不要任何说明和 markdown。示例格式:[\"健康饮食 沙拉\",\"运动 瑜伽\"]"],
  32. "outVars": ["{img-prompt-json}"]
  33. },
  34. {
  35. "type": "echo",
  36. "inVars": ["{img-prompt-json}"]
  37. },
  38. {
  39. "type": "json",
  40. "method": "json-to-arr",
  41. "inVars": ["{img-prompt-json}"],
  42. "outVars": ["{img-prompt-arr}"]
  43. },
  44. {
  45. "type": "echo",
  46. "inVars": ["{img-prompt-arr}[0]"]
  47. },
  48. {
  49. "type": "echo",
  50. "inVars": ["开始下载配图"]
  51. },
  52. {
  53. "type": "for",
  54. "indexVariable": "{idx}",
  55. "array": "{img-prompt-arr}",
  56. "body":
  57. [
  58. {
  59. "type": "try",
  60. "try":
  61. [
  62. {
  63. "type": "download-img",
  64. "inVars": ["{img-prompt-arr}[{idx}]", "tmp/pic{idx}.png"],
  65. "outVars": []
  66. }
  67. ],
  68. "fail":
  69. [
  70. {
  71. "type": "ai",
  72. "method": "text2text",
  73. "inVars": ["根据:{article}的内容,为配图给出一个图片的 prompt(简短关键词或短语),不要 URL、不要 JSON、不要引号,只输出一个 prompt。"],
  74. "outVars": ["{img-prompt}"]
  75. },
  76. {
  77. "type": "download-img",
  78. "inVars": ["{img-prompt}", "tmp/pic{idx}.png"],
  79. "outVars": []
  80. }
  81. ]
  82. },
  83. {
  84. "type": "echo",
  85. "inVars": ["pic{idx}.png 下载成功"]
  86. },
  87. {
  88. "type": "adb",
  89. "method": "send-img-to-device",
  90. "inVars": ["tmp/pic{idx}.png"],
  91. "outVars": []
  92. }
  93. ]
  94. },
  95. {
  96. "type": "echo",
  97. "inVars": ["开始添加笔记"]
  98. },
  99. {
  100. "type": "img-center-point-location",
  101. "inVars": ["添加笔记.png", [0.2, 1.6]],
  102. "outVars": ["{pos}"]
  103. },
  104. {
  105. "type": "adb",
  106. "method": "click",
  107. "inVars": ["{pos}"]
  108. },
  109. {
  110. "type": "ocr",
  111. "inVars": ["从相册选择"],
  112. "outVars": ["{pos}"]
  113. },
  114. {
  115. "type": "adb",
  116. "method": "click",
  117. "inVars": ["{pos}"]
  118. },
  119. {
  120. "type": "for",
  121. "indexVariable": "{idx}",
  122. "array": "{img-prompt-arr}",
  123. "body": [
  124. {
  125. "type": "echo",
  126. "inVars": ["开始先择配图pic{idx}.png"]
  127. },
  128. {
  129. "type": "img-center-point-location",
  130. "inVars": ["tmp/pic{idx}.png", [0.1, 2.0], [0.8, "w"]],
  131. "outVars": ["{pos}"]
  132. },
  133. {
  134. "type": "adb",
  135. "method": "click",
  136. "inVars": ["{pos}"]
  137. },
  138. {
  139. "type": "img-center-point-location",
  140. "inVars": ["选中图片.png", [0.2, 1.6]],
  141. "outVars": ["{pos}"]
  142. },
  143. {
  144. "type": "adb",
  145. "method": "click",
  146. "inVars": ["{pos}"]
  147. },
  148. {
  149. "type": "adb",
  150. "method": "keyevent",
  151. "inVars": ["4"],
  152. "outVars": []
  153. }
  154. ]
  155. },
  156. {
  157. "type": "ocr",
  158. "inVars": ["下一步"],
  159. "outVars": ["{pos}"]
  160. },
  161. {
  162. "type": "adb",
  163. "method": "click",
  164. "inVars": ["{pos}"]
  165. },
  166. {
  167. "type": "ocr",
  168. "inVars": ["下一步"],
  169. "outVars": ["{pos}"]
  170. },
  171. {
  172. "type": "adb",
  173. "method": "click",
  174. "inVars": ["{pos}"]
  175. },
  176. {
  177. "type": "adb",
  178. "method": "input",
  179. "inVars": ["{article}"]
  180. },
  181. {
  182. "type": "echo",
  183. "inVars": ["开始查找并点击发布"]
  184. },
  185. {
  186. "type": "ocr",
  187. "inVars": ["发布"],
  188. "outVars": ["{pos}"]
  189. },
  190. {
  191. "type": "adb",
  192. "method": "click",
  193. "inVars": ["{pos}"]
  194. },
  195. {
  196. "type": "echo",
  197. "inVars": ["已点击发布"]
  198. },
  199. {
  200. "type": "echo",
  201. "inVars": ["流程结束"]
  202. }
  203. ]
  204. }