lcode-cli 0.48.0__tar.gz → 0.49.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (213) hide show
  1. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/CHANGELOG.md +25 -1
  2. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/PKG-INFO +7 -5
  3. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/README.md +6 -4
  4. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/docs/configuration.md +2 -2
  5. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/docs/mcp.md +4 -2
  6. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/docs/modes.md +66 -10
  7. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/docs/quickstart.md +1 -1
  8. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/src/lcode/__init__.py +1 -1
  9. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/src/lcode/agent.py +1 -0
  10. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/src/lcode/cli.py +12 -0
  11. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/src/lcode/film.py +11 -5
  12. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/src/lcode/media.py +46 -12
  13. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/src/lcode/media.toml +33 -1
  14. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/src/lcode/media_catalog.py +27 -11
  15. lcode_cli-0.49.0/src/lcode/media_cloud.py +461 -0
  16. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/src/lcode/modes.py +10 -9
  17. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/src/lcode/repl.py +5 -0
  18. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/tests/test_film.py +3 -0
  19. lcode_cli-0.49.0/tests/test_media_cloud.py +263 -0
  20. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/.editorconfig +0 -0
  21. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/.github/CODEOWNERS +0 -0
  22. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/.github/ISSUE_TEMPLATE/bug_report.yml +0 -0
  23. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/.github/ISSUE_TEMPLATE/config.yml +0 -0
  24. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/.github/ISSUE_TEMPLATE/feature_request.yml +0 -0
  25. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/.github/ISSUE_TEMPLATE/model_request.yml +0 -0
  26. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
  27. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/.github/dependabot.yml +0 -0
  28. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/.github/workflows/ci.yml +0 -0
  29. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/.github/workflows/docs.yml +0 -0
  30. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/.github/workflows/release.yml +0 -0
  31. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/.gitignore +0 -0
  32. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/.pre-commit-config.yaml +0 -0
  33. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/AGENTS.md +0 -0
  34. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/CODE_OF_CONDUCT.md +0 -0
  35. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/CONTRIBUTING.md +0 -0
  36. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/LICENSE +0 -0
  37. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/SECURITY.md +0 -0
  38. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/action.yml +0 -0
  39. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/docs/agents.md +0 -0
  40. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/docs/assets/demo.svg +0 -0
  41. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/docs/assets/extra.css +0 -0
  42. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/docs/assets/film-fox-and-kitten.jpg +0 -0
  43. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/docs/automation.md +0 -0
  44. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/docs/bench.md +0 -0
  45. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/docs/changelog.md +0 -0
  46. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/docs/commands.md +0 -0
  47. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/docs/contributing.md +0 -0
  48. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/docs/editors.md +0 -0
  49. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/docs/git.md +0 -0
  50. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/docs/hooks.md +0 -0
  51. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/docs/how-it-works.md +0 -0
  52. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/docs/index.md +0 -0
  53. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/docs/installation.md +0 -0
  54. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/docs/lsp.md +0 -0
  55. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/docs/memory.md +0 -0
  56. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/docs/models.md +0 -0
  57. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/docs/sandbox.md +0 -0
  58. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/docs/search.md +0 -0
  59. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/docs/servers.md +0 -0
  60. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/docs/troubleshooting.md +0 -0
  61. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/docs/usage.md +0 -0
  62. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/examples/README.md +0 -0
  63. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/examples/api/fix_tests.py +0 -0
  64. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/examples/commands/review.md +0 -0
  65. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/examples/skills/commit-message/SKILL.md +0 -0
  66. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/examples/skills/commit-message/scripts/staged.sh +0 -0
  67. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/install.sh +0 -0
  68. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/mkdocs.yml +0 -0
  69. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/overrides/main.html +0 -0
  70. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/pyproject.toml +0 -0
  71. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/scripts/make_logos.py +0 -0
  72. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/scripts/record_demo.py +0 -0
  73. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/scripts/social-preview.html +0 -0
  74. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/src/lcode/__main__.py +0 -0
  75. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/src/lcode/acp.py +0 -0
  76. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/src/lcode/action.py +0 -0
  77. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/src/lcode/api.py +0 -0
  78. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/src/lcode/assistant.py +0 -0
  79. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/src/lcode/backends.py +0 -0
  80. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/src/lcode/bench.py +0 -0
  81. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/src/lcode/bench_backend.py +0 -0
  82. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/src/lcode/bench_runtime.py +0 -0
  83. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/src/lcode/catalog.py +0 -0
  84. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/src/lcode/checkpoints.py +0 -0
  85. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/src/lcode/checks.py +0 -0
  86. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/src/lcode/clipboard.py +0 -0
  87. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/src/lcode/cloud.py +0 -0
  88. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/src/lcode/codesearch.py +0 -0
  89. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/src/lcode/comfy.py +0 -0
  90. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/src/lcode/config.py +0 -0
  91. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/src/lcode/context.py +0 -0
  92. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/src/lcode/edits.py +0 -0
  93. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/src/lcode/escalate.py +0 -0
  94. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/src/lcode/extensions.py +0 -0
  95. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/src/lcode/frontmatter.py +0 -0
  96. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/src/lcode/gitflow.py +0 -0
  97. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/src/lcode/hardware.py +0 -0
  98. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/src/lcode/hooks.py +0 -0
  99. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/src/lcode/imageopts.py +0 -0
  100. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/src/lcode/jobs.py +0 -0
  101. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/src/lcode/limits.py +0 -0
  102. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/src/lcode/lsp.py +0 -0
  103. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/src/lcode/matching.py +0 -0
  104. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/src/lcode/mcp/__init__.py +0 -0
  105. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/src/lcode/mcp/auth.py +0 -0
  106. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/src/lcode/mcp/catalog.py +0 -0
  107. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/src/lcode/mcp/catalog.toml +0 -0
  108. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/src/lcode/mcp/client.py +0 -0
  109. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/src/lcode/mcp/commands.py +0 -0
  110. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/src/lcode/mcp/config.py +0 -0
  111. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/src/lcode/mcp/http.py +0 -0
  112. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/src/lcode/mcp/manager.py +0 -0
  113. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/src/lcode/mcp/protocol.py +0 -0
  114. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/src/lcode/mcp/server.py +0 -0
  115. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/src/lcode/mcp/stdio.py +0 -0
  116. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/src/lcode/memory.py +0 -0
  117. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/src/lcode/models.toml +0 -0
  118. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/src/lcode/notify.py +0 -0
  119. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/src/lcode/ollama.py +0 -0
  120. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/src/lcode/permissions.py +0 -0
  121. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/src/lcode/planning.py +0 -0
  122. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/src/lcode/preview.py +0 -0
  123. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/src/lcode/render.py +0 -0
  124. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/src/lcode/repeats.py +0 -0
  125. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/src/lcode/repomap.py +0 -0
  126. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/src/lcode/residency.py +0 -0
  127. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/src/lcode/review.py +0 -0
  128. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/src/lcode/sandbox.py +0 -0
  129. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/src/lcode/screenshots.py +0 -0
  130. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/src/lcode/secretscan.py +0 -0
  131. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/src/lcode/servers/__init__.py +0 -0
  132. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/src/lcode/servers/encord.py +0 -0
  133. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/src/lcode/servers/valohai.py +0 -0
  134. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/src/lcode/servers/xai.py +0 -0
  135. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/src/lcode/sessions.py +0 -0
  136. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/src/lcode/steer.py +0 -0
  137. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/src/lcode/subagents.py +0 -0
  138. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/src/lcode/tools.py +0 -0
  139. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/src/lcode/unreachable.py +0 -0
  140. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/src/lcode/update.py +0 -0
  141. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/src/lcode/vision.py +0 -0
  142. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/src/lcode/web.py +0 -0
  143. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/src/lcode/workflows/__init__.py +0 -0
  144. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/src/lcode/workflows/flux2-klein-4b-t2i.json +0 -0
  145. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/src/lcode/workflows/remove-background.json +0 -0
  146. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/src/lcode/workflows/smooth-film.json +0 -0
  147. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/src/lcode/workflows/sound-stable-audio.json +0 -0
  148. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/src/lcode/workflows/upscale-esrgan.json +0 -0
  149. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/src/lcode/workflows/upscale-video-esrgan.json +0 -0
  150. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/src/lcode/workflows/wan21-fun-camera.json +0 -0
  151. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/src/lcode/workflows/wan21-vace.json +0 -0
  152. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/src/lcode/workflows/wan22-fun-inp-5b.json +0 -0
  153. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/src/lcode/workflows/wan22-ti2v-5b.json +0 -0
  154. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/src/lcode/workflows/z-image-turbo-t2i.json +0 -0
  155. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/tests/comfy_standin.py +0 -0
  156. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/tests/conftest.py +0 -0
  157. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/tests/fake_lsp_server.py +0 -0
  158. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/tests/fake_mcp_server.py +0 -0
  159. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/tests/test_acp.py +0 -0
  160. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/tests/test_action.py +0 -0
  161. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/tests/test_agent.py +0 -0
  162. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/tests/test_api.py +0 -0
  163. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/tests/test_assistant.py +0 -0
  164. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/tests/test_backends.py +0 -0
  165. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/tests/test_bench.py +0 -0
  166. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/tests/test_catalog.py +0 -0
  167. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/tests/test_checkpoints.py +0 -0
  168. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/tests/test_checks.py +0 -0
  169. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/tests/test_cli.py +0 -0
  170. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/tests/test_clipboard.py +0 -0
  171. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/tests/test_cloud.py +0 -0
  172. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/tests/test_codesearch.py +0 -0
  173. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/tests/test_comfy.py +0 -0
  174. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/tests/test_config.py +0 -0
  175. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/tests/test_context.py +0 -0
  176. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/tests/test_context_picker.py +0 -0
  177. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/tests/test_escalate.py +0 -0
  178. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/tests/test_extensions.py +0 -0
  179. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/tests/test_gitflow.py +0 -0
  180. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/tests/test_hooks.py +0 -0
  181. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/tests/test_image_edit.py +0 -0
  182. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/tests/test_image_generate.py +0 -0
  183. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/tests/test_jobs.py +0 -0
  184. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/tests/test_look.py +0 -0
  185. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/tests/test_lsp.py +0 -0
  186. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/tests/test_matching.py +0 -0
  187. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/tests/test_mcp.py +0 -0
  188. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/tests/test_media_catalog.py +0 -0
  189. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/tests/test_memory.py +0 -0
  190. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/tests/test_model_picker.py +0 -0
  191. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/tests/test_modes.py +0 -0
  192. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/tests/test_permissions.py +0 -0
  193. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/tests/test_plan_mode.py +0 -0
  194. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/tests/test_repeats.py +0 -0
  195. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/tests/test_repomap.py +0 -0
  196. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/tests/test_residency.py +0 -0
  197. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/tests/test_review.py +0 -0
  198. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/tests/test_robustness.py +0 -0
  199. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/tests/test_sandbox.py +0 -0
  200. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/tests/test_screenshots.py +0 -0
  201. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/tests/test_secretscan.py +0 -0
  202. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/tests/test_servers.py +0 -0
  203. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/tests/test_sessions.py +0 -0
  204. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/tests/test_steer.py +0 -0
  205. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/tests/test_stuck.py +0 -0
  206. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/tests/test_subagents.py +0 -0
  207. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/tests/test_tools.py +0 -0
  208. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/tests/test_update.py +0 -0
  209. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/tests/test_video.py +0 -0
  210. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/tests/test_vision.py +0 -0
  211. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/tests/test_web.py +0 -0
  212. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/tests/test_xai.py +0 -0
  213. {lcode_cli-0.48.0 → lcode_cli-0.49.0}/uv.lock +0 -0
@@ -6,6 +6,29 @@ All notable changes to lcode are documented here. The format follows
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.49.0] - 2026-10-24
10
+
11
+ ### Added
12
+
13
+ - **Cloud generation in image and video mode** (#157): xAI's Grok Imagine as cloud models,
14
+ `grok-image` (pictures, edits of one picture) and `grok-video` (clips from text or a start
15
+ picture), chosen with `/model` and marked *cloud* in `/models` and `lcode media`. Before each
16
+ request lcode shows what goes where and about what it costs, and sends nothing until you say yes;
17
+ the session's total is shown after. The key comes from `XAI_API_KEY` only and goes to xAI's API
18
+ only. What a cloud model can't do here (masks, several pictures, clips between two frames…) is
19
+ made by a local model. See [In the cloud](https://nasser1941.github.io/lcode/modes/#in-the-cloud-grok-imagine).
20
+
21
+ ### Changed
22
+
23
+ - The README no longer says code mode makes images through MCP servers (it hasn't since 0.40.0).
24
+
25
+ ### Fixed
26
+
27
+ - **Films:** things and places no longer become cast members. A kite in the cast got a "character" picture
28
+ (a person behind a kite) and walked on legs in every shot. The storyboard now keeps the cast to living
29
+ characters and describes things in the shots: in 12 storyboards for ideas with props, things in the cast
30
+ went from 6 to 1 (a plant).
31
+
9
32
  ## [0.48.0] - 2026-10-24
10
33
 
11
34
  ### Added
@@ -1026,7 +1049,8 @@ First public release.
1026
1049
  - `AGENTS.md` project instructions and `/init` to generate them.
1027
1050
  - One-line installer for Linux and macOS.
1028
1051
 
1029
- [Unreleased]: https://github.com/nasser1941/lcode/compare/v0.48.0...HEAD
1052
+ [Unreleased]: https://github.com/nasser1941/lcode/compare/v0.49.0...HEAD
1053
+ [0.49.0]: https://github.com/nasser1941/lcode/compare/v0.48.0...v0.49.0
1030
1054
  [0.48.0]: https://github.com/nasser1941/lcode/compare/v0.47.0...v0.48.0
1031
1055
  [0.47.0]: https://github.com/nasser1941/lcode/compare/v0.46.0...v0.47.0
1032
1056
  [0.46.0]: https://github.com/nasser1941/lcode/compare/v0.45.0...v0.46.0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: lcode-cli
3
- Version: 0.48.0
3
+ Version: 0.49.0
4
4
  Summary: A local-first terminal coding agent powered by open-weight models on your own GPU or Mac, via Ollama.
5
5
  Project-URL: Homepage, https://nasser1941.github.io/lcode/
6
6
  Project-URL: Documentation, https://nasser1941.github.io/lcode/
@@ -118,11 +118,13 @@ through [Ollama](https://ollama.com), and when it needs current information it c
118
118
  with tool calling. Or use LM Studio, llama.cpp, vLLM or MLX instead of Ollama.
119
119
  - **MCP servers, ready to go.** Connect Jira and Confluence, GitHub, AWS, Google Drive, Grafana,
120
120
  Google Cloud, Sentry, Linear, Notion, Postgres, Kubernetes, Metabase, Encord, Valohai and more with one command
121
- (`lcode mcp add atlassian`), image generation with ComfyUI, or any other MCP server. Browser sign-in (OAuth) is built in.
121
+ (`lcode mcp add atlassian`), or any other MCP server. Browser sign-in (OAuth) is built in.
122
122
  - **Sees images.** Attach a screenshot or mockup with `@path` and lcode looks at it, using the
123
- vision part of your model. With ComfyUI (`lcode mcp add comfyui`) it can also generate and edit
124
- images with local models such as FLUX, SDXL and Qwen-Image, or, in the cloud, images, videos
125
- and speech with xAI's Grok Imagine (`lcode mcp add xai`).
123
+ vision part of your model.
124
+ - **Images, videos and films.** Image and video [modes](https://nasser1941.github.io/lcode/modes/)
125
+ (`/mode image`) make pictures, edits, clips and short films with local models run by ComfyUI
126
+ (FLUX.2 klein, Wan 2.2, installed on demand), or with xAI's Grok Imagine and your own key, after
127
+ showing what it costs.
126
128
  - **Web search when needed.** Looks up the latest versions, docs and error messages with Ollama web
127
129
  search, Brave, Tavily or your own SearXNG, and reads pages as clean text.
128
130
  - **Private.** The model runs on your machine, lcode never uploads your files and has no telemetry.
@@ -82,11 +82,13 @@ through [Ollama](https://ollama.com), and when it needs current information it c
82
82
  with tool calling. Or use LM Studio, llama.cpp, vLLM or MLX instead of Ollama.
83
83
  - **MCP servers, ready to go.** Connect Jira and Confluence, GitHub, AWS, Google Drive, Grafana,
84
84
  Google Cloud, Sentry, Linear, Notion, Postgres, Kubernetes, Metabase, Encord, Valohai and more with one command
85
- (`lcode mcp add atlassian`), image generation with ComfyUI, or any other MCP server. Browser sign-in (OAuth) is built in.
85
+ (`lcode mcp add atlassian`), or any other MCP server. Browser sign-in (OAuth) is built in.
86
86
  - **Sees images.** Attach a screenshot or mockup with `@path` and lcode looks at it, using the
87
- vision part of your model. With ComfyUI (`lcode mcp add comfyui`) it can also generate and edit
88
- images with local models such as FLUX, SDXL and Qwen-Image, or, in the cloud, images, videos
89
- and speech with xAI's Grok Imagine (`lcode mcp add xai`).
87
+ vision part of your model.
88
+ - **Images, videos and films.** Image and video [modes](https://nasser1941.github.io/lcode/modes/)
89
+ (`/mode image`) make pictures, edits, clips and short films with local models run by ComfyUI
90
+ (FLUX.2 klein, Wan 2.2, installed on demand), or with xAI's Grok Imagine and your own key, after
91
+ showing what it costs.
90
92
  - **Web search when needed.** Looks up the latest versions, docs and error messages with Ollama web
91
93
  search, Brave, Tavily or your own SearXNG, and reads pages as clean text.
92
94
  - **Private.** The model runs on your machine, lcode never uploads your files and has no telemetry.
@@ -30,8 +30,8 @@ lcode config path # print the file location
30
30
  | `preview` | `auto` | Images in the terminal: `auto`, `kitty`, `iterm`, `blocks` (colour text) or `off` ([results](modes.md#results)) |
31
31
  | `prompt_assistant` | `video` | A small model writes fuller prompts: `video`, `all` (pictures and follow-ups too), `off`, or an Ollama model ([prompt assistant](modes.md#the-prompt-assistant)) |
32
32
  | `check_results` | `false` | The prompt assistant checks each picture against the request |
33
- | `video_model` | `wan22-ti2v-5b` | The model video mode uses: a key from `lcode media` ([video mode](modes.md#video-mode)) |
34
- | `image_model` | `flux2-klein-4b` | The model image mode uses: a key from `lcode media` ([image models](modes.md#image-models)) |
33
+ | `video_model` | `wan22-ti2v-5b` | The model video mode uses: a key from `lcode media` ([video mode](modes.md#video-mode)); `grok-video` runs at xAI ([in the cloud](modes.md#in-the-cloud-grok-imagine)) |
34
+ | `image_model` | `flux2-klein-4b` | The model image mode uses: a key from `lcode media` ([image models](modes.md#image-models)); `grok-image` runs at xAI ([in the cloud](modes.md#in-the-cloud-grok-imagine)) |
35
35
  | `think` | `true` | Let the model reason before answering |
36
36
  | `web` | `on` | Web search and page fetching: `on`, `ask` (before each search/website) or `off` |
37
37
  | `search_backend` | `auto` | `auto`, `ollama`, `brave`, `tavily` or `searxng`; `auto` uses the first one configured |
@@ -89,8 +89,10 @@ details.
89
89
 
90
90
  Code mode makes code only, so the servers that generated images and videos in earlier versions
91
91
  (`comfyui`, `xai`) aren't in the catalog any more, and lcode doesn't load them in code mode if
92
- they're still in your `mcp.json`. Image and video generation get their own [modes](modes.md),
93
- with their own models and controls.
92
+ they're still in your `mcp.json`. Image and video generation have their own [modes](modes.md),
93
+ with their own models and controls, and Grok Imagine is there as a
94
+ [cloud model](modes.md#in-the-cloud-grok-imagine). The `lcode-mcp-xai` server still works with
95
+ other MCP clients, for speech too.
94
96
 
95
97
  ### Metabase
96
98
 
@@ -5,8 +5,8 @@ lcode makes three kinds of things, each in its own mode with its own models:
5
5
  | Mode | What it makes | The model doing the work |
6
6
  |---|---|---|
7
7
  | **code** (default) | Code: it reads, writes, runs and checks your project | A coding language model in Ollama (or another server) |
8
- | **image** | Images from a description, edits of your images (references, inpainting, outpainting), upscales and cut-outs | An image model, run by ComfyUI on your GPU |
9
- | **video** | Video clips from a description or a start image | A video model, run by ComfyUI on your GPU |
8
+ | **image** | Images from a description, edits of your images (references, inpainting, outpainting), upscales and cut-outs | An image model, run by ComfyUI on your GPU, or [in the cloud](#in-the-cloud-grok-imagine) |
9
+ | **video** | Video clips from a description or a start image, and [films](#films) | A video model, run by ComfyUI on your GPU, or [in the cloud](#in-the-cloud-grok-imagine) |
10
10
 
11
11
  ```text
12
12
  ❯ /mode image
@@ -216,7 +216,8 @@ The Fox and the Kitten (.lcode/media/films/the-fox-and-the-kitten)
216
216
  ![The cast's reference pictures (right) and a frame from each of the three shots](assets/film-fox-and-kitten.jpg)
217
217
 
218
218
  1. **The storyboard:** the [prompt assistant](#the-prompt-assistant) writes it from your idea: the
219
- look of the whole film, the cast (each character described once) and the shots (what happens,
219
+ look of the whole film, the cast (each living character described once; things like a kite or a car are
220
+ described in the shots) and the shots (what happens,
220
221
  the camera, who's in it, how long). It's saved as `storyboard.json` (and a readable
221
222
  `storyboard.md`) in the film's folder.
222
223
  2. **The cast:** each character gets a reference picture, made once, in `cast/`.
@@ -286,6 +287,65 @@ assistant:
286
287
  - **The check** said every one of the six pictures matched, which they did; it hasn't been
287
288
  measured on pictures that miss.
288
289
 
290
+ ## In the cloud: Grok Imagine
291
+
292
+ For what a laptop can't run, or when speed matters, image and video mode can use xAI's Grok Imagine
293
+ with your own API key. It's chosen like a local model and marked *cloud* in `/models` and `lcode
294
+ media`. lcode reads the key from the environment only:
295
+
296
+ ```bash
297
+ export XAI_API_KEY=xai-… # from https://console.x.ai, then start lcode
298
+ ```
299
+
300
+ ```text
301
+ image ❯ /model grok-image
302
+ Image model: Grok Imagine Image 2.0.
303
+ ◆ Grok Imagine Image 2.0 runs at xAI: each request shows what goes there and about what it costs ($0.04 per image), and asks first.
304
+ image ❯ a red fox in the snow --n 2
305
+ ╭─ Make it at xAI? ─────────────────────────────────────────────────────────────────────────────╮
306
+ │ Where: Grok Imagine Image 2.0 (grok-imagine-image-2.0) at xAI, api.x.ai │
307
+ │ What goes: the prompt. Your XAI_API_KEY goes with it, to api.x.ai only. │
308
+ │ Prompt: a red fox in the snow │
309
+ │ Cost: about $0.08 (2 images × $0.04), billed to your xAI account; prices as of 2026-10-24, the │
310
+ │ real ones: https://docs.x.ai/developers/pricing │
311
+ ╰────────────────────────────────────────────────────────────────────────────────────────────────╯
312
+ Send it to xAI (about $0.08)? [y/N] y
313
+ ◆ #1 .lcode/media/20261024-153907-a-red-fox-in-the-snow-1.jpg … · Grok Imagine Image 2.0 · … s
314
+ ◆ #2 .lcode/media/20261024-153907-a-red-fox-in-the-snow-2.jpg … · Grok Imagine Image 2.0 · … s
315
+ about $0.08 at xAI (this session: about $0.08)
316
+ ```
317
+
318
+ | Model | `/model` | Makes | Price (xAI's, on 2026-10-24) |
319
+ |---|---|---|---|
320
+ | **Grok Imagine Image 2.0** | `grok-image` | Pictures from text; edits of one picture | $0.04 per picture, 1k or 2k; $0.01 per picture sent |
321
+ | **Grok Imagine Video 1.5** | `grok-video` | Clips from text or a start picture | Per second: $0.08 at 480p, $0.14 at 720p, $0.25 at 1080p; $0.01 per picture sent |
322
+
323
+ - **What's sent:** the prompt (the [prompt assistant](#the-prompt-assistant)'s fuller one when it
324
+ wrote one, shown above the panel) and the picture you edit or start a clip from. Nothing else:
325
+ not your project, not other pictures, not the conversation.
326
+ - **The key** goes in the request's `Authorization` header to xAI's API, and nowhere else. Results
327
+ are downloaded from the address xAI gives, without it. `XAI_API_BASE` sends the requests, key
328
+ included, to another address, such as a proxy you run.
329
+ - **What it costs** is shown before every request, from lcode's copy of xAI's prices with the date
330
+ they were checked, and nothing is sent until you say yes. The line under the results adds it to
331
+ the session's total. It's an estimate: xAI bills by its [pricing page](https://docs.x.ai/developers/pricing).
332
+ - **Options:** `--quality` picks the resolution: pictures are 1k (`fast`, `balanced`) or 2k
333
+ (`best`), at the same price; clips are 480p, 720p or 1080p. `--ar` picks the nearest shape xAI
334
+ offers. `--camera` becomes words in the prompt. Seeds and `--no` aren't used.
335
+ - **What it doesn't do here** is made by a local model, and lcode says which: masks, several
336
+ pictures at once and extending a picture (FLUX.2 klein); clips between two frames, reference
337
+ pictures, extending and restyling a clip (the Wan models).
338
+ - **Stopping:** Esc or Ctrl+C stops waiting for a clip, but xAI may still make it and bill it. The
339
+ message gives the request's id.
340
+ - **No terminal, no cloud:** `lcode -p` in image or video mode refuses a cloud model, because
341
+ nobody can say yes to the cost.
342
+ - **[Films](#films)** work with cloud models too; each picture and clip asks.
343
+ - **Files:** results land in the media folder and the gallery as local ones do. The JSON next to
344
+ each says what was sent, to which model, the estimated cost and xAI's request id for a clip.
345
+ xAI's terms and usage policies apply to what you send.
346
+ - **Tested** against a stand-in for xAI's API that answers as its documentation describes; prices
347
+ are from xAI's pricing page.
348
+
289
349
  ## ComfyUI
290
350
 
291
351
  ComfyUI runs the image and video models; lcode drives it through its API.
@@ -372,18 +432,14 @@ memory a model *needs* is lower than what `nvidia-smi` shows while it runs.
372
432
 
373
433
  ## One model on the GPU at a time
374
434
 
375
- Image and video modes don't need the big coding model: the image or video model does the work. A
376
- small optional model will help with prompts later. Image and video models need the GPU to
377
- themselves:
435
+ Image and video modes don't need the big coding model: the image or video model does the work, and
436
+ the [prompt assistant](#the-prompt-assistant) loads only while it writes. Image and video models
437
+ need the GPU to themselves:
378
438
 
379
439
  - **Into image or video mode:** lcode unloads its coding model from Ollama, and checks again
380
440
  before each image.
381
441
  - **Back to code mode:** lcode stops the ComfyUI it started, or asks yours to free its memory,
382
442
  then loads the coding model again in the background.
383
443
 
384
- ## Coming next
385
-
386
- - **#157 Cloud generation**, with costs shown (Grok Imagine first).
387
-
388
444
  The permission mode (`ask`, `plan`, `auto-edit`, `yolo`) is a different setting: `/permissions`
389
445
  sets it, and Shift+Tab cycles it as before.
@@ -12,7 +12,7 @@ lcode
12
12
 
13
13
  ```text
14
14
  ╭──────────────────────────────────────────────╮
15
- │ lcode v0.48.0 — local coding agent │
15
+ │ lcode v0.49.0 — local coding agent │
16
16
  │ │
17
17
  │ model lcode-qwen3.6-35b │
18
18
  │ context 256K tokens │
@@ -3,7 +3,7 @@
3
3
  From a program: `from lcode import Session` (see lcode.api).
4
4
  """
5
5
 
6
- __version__ = "0.48.0"
6
+ __version__ = "0.49.0"
7
7
 
8
8
  API = ("Session", "Result", "Options", "SetupError")
9
9
 
@@ -385,6 +385,7 @@ class Agent:
385
385
  self.media_results: list[dict] = [] # the session's images, numbered (/gallery, /vary, /open)
386
386
  self.last_request: dict | None = None # what /again repeats (lcode.media.redo)
387
387
  self.image_refs: list[str] = [] # images every next request follows (/use)
388
+ self.cloud_spent = 0.0 # dollars, about, spent at cloud image and video models this session (media_cloud)
388
389
  self.reflected = 0 # messages before this index were already checked for notes to remember
389
390
  self._memory: memory_notes.Memory | None = None
390
391
  self._agent_types: tuple[Path, dict[str, subagents.AgentType], list[str]] | None = None
@@ -781,6 +781,13 @@ def comfyui_status(cfg: dict) -> tuple[str, bool | None]:
781
781
  from lcode import media_catalog as catalog
782
782
 
783
783
  model = catalog.load().find(cfg.get("image_model") or "") or catalog.load().models[catalog.DEFAULT_IMAGE]
784
+ if model.cloud:
785
+ from lcode import media_cloud
786
+
787
+ p = media_cloud.provider(model)
788
+ if not p.api_key():
789
+ return f"image model: {model.name}, at {p.name}, but {p.key_env} isn't set ({p.keys_url})", None
790
+ return f"image model: {model.name}, at {p.name} ({p.key_env} is set)", True
784
791
  server = comfy.Server(cfg["comfyui_url"])
785
792
  stats = server.stats()
786
793
  install = None if stats else comfy.find_install(cfg["comfyui_path"])
@@ -1085,6 +1092,11 @@ def cmd_media(args) -> None:
1085
1092
  model = cat.find(args.model or "")
1086
1093
  if model is None:
1087
1094
  fail(f"no media model {args.model!r}: lcode media lists them")
1095
+ if model.cloud:
1096
+ from lcode import media_cloud
1097
+
1098
+ console.print(f"Nothing to install: {media_cloud.ready_note(model)}")
1099
+ return
1088
1100
  if not running and install is None:
1089
1101
  fail(f"lcode needs ComfyUI to install models into. {comfy.install_hint()}")
1090
1102
  ask = None if args.yes else (lambda q: Confirm.ask(q, default=True, console=console))
@@ -1,8 +1,9 @@
1
1
  """Films: from one description to a short film with the same characters in every shot.
2
2
 
3
3
  1. **A storyboard.** The prompt assistant (lcode.assistant) writes it: a title, the look of the whole film, the cast
4
- (each character or place described once), and the shots (what happens, how long, the camera, who's in it). It's
5
- saved as `storyboard.json` in the film's folder, so it can be edited and made again.
4
+ (each living character described once; things and places are described in the shots), and the shots (what
5
+ happens, how long, the camera, who's in it). It's saved as `storyboard.json` in the film's folder, so it can be
6
+ edited and made again.
6
7
  2. **The cast.** Each character gets a reference picture (FLUX.2 klein), made once and kept in `cast/`.
7
8
  3. **The shots.** Each shot starts as a keyframe: a picture of the shot made with the cast's pictures as references,
8
9
  so the characters look the same from shot to shot. Video mode's model then animates the keyframe.
@@ -37,8 +38,10 @@ STORYBOARD = (
37
38
  '"what happens in this shot, where, and who is in it, in one or two sentences, using the cast names", "camera": '
38
39
  '"a shot type and camera move, like slow zoom in, tracking shot, static wide shot", "cast": ["names in this '
39
40
  'shot"], "seconds": {seconds}}}]}}\n'
40
- "Use one to three cast members, the same names in every shot. Each shot is one continuous moment; the film "
41
- "tells a small story from the first shot to the last. Describe what is seen, never what is felt or heard."
41
+ "The cast is one to three living characters (people, animals, creatures), with the same names in every shot. "
42
+ "Things and places are never cast members: a kite, a car, a house or a forest is described in the shots. Each "
43
+ "shot is one continuous moment; the film tells a small story from the first shot to the last. Describe what is "
44
+ "seen, never what is felt or heard."
42
45
  )
43
46
  TRANSITIONS = ("cut", "fade")
44
47
  FADE = 0.5 # seconds a fade takes
@@ -203,7 +206,10 @@ def make(
203
206
  if picture.exists():
204
207
  continue
205
208
  say(f"Cast: {name}")
206
- prompt = f"{board.look} Character reference of {name}: {desc}. Full body, facing the camera, plain background."
209
+ prompt = (
210
+ f"{board.look} Character reference of {name}, alone: {desc}. Full body, facing the camera, plain "
211
+ "background."
212
+ )
207
213
  made = with_mode(agent, "image", lambda p=prompt: media.generate_image(
208
214
  agent, p, cancelled, ask, imageopts.Options(size="3:4", quality=board.quality))) # fmt: skip
209
215
  keep(made.files[0], picture)
@@ -1,7 +1,7 @@
1
1
  """Image and video mode: a request becomes media, made by ComfyUI (lcode.comfy) with no language model in between.
2
2
 
3
- Image mode makes one image per request with the image model chosen from the media catalog (lcode.media_catalog);
4
- sizes, variations and a gallery come with #151, video with #153.
3
+ The image or video model is chosen from the media catalog (lcode.media_catalog). A cloud model there (Grok Imagine)
4
+ makes what it can at its provider instead, after showing the cost (lcode.media_cloud).
5
5
  """
6
6
 
7
7
  from __future__ import annotations
@@ -23,7 +23,7 @@ from typing import TYPE_CHECKING
23
23
  import requests
24
24
  from rich.text import Text
25
25
 
26
- from lcode import assistant, comfy, edits, imageopts, preview
26
+ from lcode import assistant, comfy, edits, imageopts, media_cloud, preview
27
27
  from lcode import media_catalog as catalog
28
28
 
29
29
  if TYPE_CHECKING:
@@ -112,6 +112,8 @@ def offer_install(agent: Agent, server: comfy.Server, ask: Callable[[str], bool]
112
112
 
113
113
  def warm(agent: Agent) -> str | None:
114
114
  """Start ComfyUI in the background on entering image or video mode, so the first request waits less."""
115
+ if current(agent).cloud:
116
+ return None # it runs at its provider; ComfyUI starts when a local model is needed
115
117
  if agent.comfy_process is not None and agent.comfy_process.poll() is None:
116
118
  return None
117
119
  if comfy.Server(agent.settings.comfyui_url).stats():
@@ -335,6 +337,12 @@ def redo(
335
337
  agent.last_request = job
336
338
  if not job.get("raw") and job["kind"] in ("image", "edit", "video") and not job.get("pads"):
337
339
  job = {**job, "expanded": expand(agent, job)}
340
+ if model.cloud and not media_cloud.cannot(model, job): # at its provider: all of them, asked once
341
+ made = media_cloud.make(agent, model, job, options, cancelled, ask)
342
+ if job["kind"] in ("image", "edit"):
343
+ for one in made:
344
+ check_result(agent, one, prompt)
345
+ return made
338
346
  made = []
339
347
  for i in range(options.n):
340
348
  seed = None if options.seed is None else options.seed + i
@@ -493,8 +501,11 @@ def generate_image(
493
501
  if not prompt:
494
502
  raise MediaError("Describe the image you want.")
495
503
  options = options or imageopts.Options()
496
- server = prepare(agent, ask, cancelled)
497
504
  model = current(agent, "image")
505
+ if model.cloud:
506
+ job = {"kind": "image", "prompt": prompt, "expanded": expanded, "sources": []}
507
+ return media_cloud.make(agent, model, job, replace(options, n=1), cancelled, ask)[0]
508
+ server = prepare(agent, ask, cancelled)
498
509
  files = ensure_installed(agent, model, server, ask)
499
510
  workflow = comfy.load_workflow(model.workflow)
500
511
  seed = options.seed if options.seed is not None else random.randrange(2**32)
@@ -522,13 +533,17 @@ def edit_image(
522
533
  ) -> Made:
523
534
  """An edit of the job's source images: by instruction, through a mask (inpainting), or on a bigger canvas
524
535
  (outpainting). The first source sets the shape unless the request gave one."""
525
- server = prepare(agent, ask, cancelled)
526
536
  chosen = current(agent, "image")
537
+ why = media_cloud.cannot(chosen, {**job, "kind": "edit"}) if chosen.cloud else ""
538
+ if chosen.cloud and not why: # films call this directly
539
+ return media_cloud.make(agent, chosen, {**job, "kind": "edit"}, replace(options, n=1), cancelled, ask)[0]
540
+ server = prepare(agent, ask, cancelled)
527
541
  model = catalog.load().editor(chosen)
528
542
  if model is None:
529
543
  raise MediaError("None of lcode's image models edits pictures yet.")
530
544
  if model.key != chosen.key:
531
- agent.say(f"{chosen.name} doesn't edit pictures: {model.name} makes this one.")
545
+ reason = f"doesn't do {why} here" if why else "doesn't edit pictures"
546
+ agent.say(f"{chosen.name} {reason}: {model.name} makes this one{' on your GPU' if chosen.cloud else ''}.")
532
547
  files = ensure_installed(agent, model, server, ask)
533
548
  workflow = comfy.load_workflow(model.workflow)
534
549
  sources = [Path(p) for p in job["sources"]]
@@ -600,7 +615,7 @@ def generate_video(
600
615
  restyle = Path(job["restyle"]) if job.get("restyle") else None
601
616
  task = (
602
617
  "restyle" if restyle else "references" if refs else "first-last-frame" if end
603
- else "camera" if options.camera else "image-to-video" if clip else ""
618
+ else "camera" if options.camera else "extend" if clip else ""
604
619
  ) # fmt: skip
605
620
  model = video_model(agent, task)
606
621
  files = ensure_installed(agent, model, server, ask)
@@ -678,7 +693,7 @@ VIDEO_LATENTS = ("Wan22ImageToVideoLatent", "WanFunInpaintToVideo", "WanCameraIm
678
693
  WHY = {
679
694
  "first-last-frame": "a clip between two frames",
680
695
  "camera": "a camera move",
681
- "image-to-video": "continuing a clip",
696
+ "extend": "extending a clip",
682
697
  "references": "following reference pictures",
683
698
  "restyle": "restyling a clip",
684
699
  }
@@ -722,14 +737,15 @@ def control_from(graph: dict, clip_name: str, length: int) -> list:
722
737
 
723
738
 
724
739
  def video_model(agent: Agent, task: str) -> catalog.MediaModel:
725
- """The video model for a job: the chosen one, or the first that does what the job needs."""
740
+ """The video model for a job: the chosen one, or the first local one that does what the job needs."""
726
741
  chosen = current(agent, "video")
727
- if not task or task in chosen.tasks:
742
+ if not chosen.cloud and (not task or task in chosen.tasks):
728
743
  return chosen
729
- model = catalog.load().for_task("video", task)
744
+ model = catalog.load().for_task("video", task or "text-to-video")
730
745
  if model is None:
731
746
  raise MediaError(f"None of lcode's video models does {WHY.get(task, task)} yet.")
732
- agent.say(f"{model.name} makes this one ({WHY.get(task, task)}).")
747
+ where = f"; {chosen.name} doesn't do that here" if chosen.cloud else ""
748
+ agent.say(f"{model.name} makes this one ({WHY.get(task, task)}{where}).")
733
749
  return model
734
750
 
735
751
 
@@ -786,6 +802,24 @@ def mp4_seconds(path: Path) -> float:
786
802
  return duration / scale if scale else 0.0
787
803
 
788
804
 
805
+ def mp4_size(path: Path) -> tuple[int, int]:
806
+ """An MP4's picture size from its first video track header (tkhd), or (0, 0)."""
807
+ try:
808
+ data = path.read_bytes()[: 1 << 22]
809
+ except OSError:
810
+ return 0, 0
811
+ i = data.find(b"tkhd")
812
+ while i >= 4:
813
+ size = 8 + (96 if data[i + 4 : i + 5] == b"\x01" else 84) # the box, with its size and type
814
+ end = i - 4 + size # width and height end it, as 16.16 fixed-point numbers
815
+ if struct.unpack(">I", data[i - 4 : i])[0] == size and end <= len(data):
816
+ width, height = struct.unpack(">II", data[end - 8 : end])
817
+ if width and height:
818
+ return width >> 16, height >> 16
819
+ i = data.find(b"tkhd", i + 4)
820
+ return 0, 0
821
+
822
+
789
823
  def apply_tool(
790
824
  agent: Agent,
791
825
  task: str,
@@ -19,6 +19,12 @@
19
19
  # negative whether it uses a negative prompt (distilled models don't)
20
20
  # edit how it edits images: "reference-latent" (its text-to-image workflow, given the images as
21
21
  # reference latents on both conditionings); absent: it doesn't edit
22
+ #
23
+ # Cloud models (lcode.media_cloud) have no files or workflow; they run at a provider, with the user's API key:
24
+ # cloud the provider: xai
25
+ # api_model the provider's name for the model
26
+ # price dollars: image (per picture made), input_image (per picture sent), 480p / 720p / 1080p (per second)
27
+ # priced when the prices were checked (they change: the provider's pricing page has the real ones)
22
28
 
23
29
  [files.flux-2-klein-4b-fp8]
24
30
  folder = "diffusion_models"
@@ -139,7 +145,7 @@ name = "Wan 2.2 TI2V 5B"
139
145
  mode = "video"
140
146
  publisher = "Wan-AI (Alibaba)"
141
147
  license = "Apache 2.0"
142
- tasks = ["text-to-video", "image-to-video"]
148
+ tasks = ["text-to-video", "image-to-video", "extend"]
143
149
  workflow = "wan22-ti2v-5b"
144
150
  files = { model = "wan22-ti2v-5b", text_encoder = "umt5-xxl-fp8", vae = "wan22-vae" }
145
151
  gpu_gb = 0.0
@@ -254,3 +260,29 @@ tasks = ["sound"]
254
260
  workflow = "sound-stable-audio"
255
261
  files = { model = "stable-audio-open", text_encoder = "t5-base" }
256
262
  notes = "/sound: sound effects and ambience for a clip, up to 47 s"
263
+
264
+ # ----------------------------------------------------------------------------- in the cloud: your key, your bill
265
+
266
+ [models.grok-image]
267
+ name = "Grok Imagine Image 2.0"
268
+ mode = "image"
269
+ publisher = "xAI"
270
+ license = "xAI's terms of service"
271
+ tasks = ["text-to-image", "edit"]
272
+ cloud = "xai"
273
+ api_model = "grok-imagine-image-2.0"
274
+ price = { image = 0.04, input_image = 0.01 }
275
+ priced = "2026-10-24"
276
+ notes = "1k or 2k (--quality best); edits one picture at a time"
277
+
278
+ [models.grok-video]
279
+ name = "Grok Imagine Video 1.5"
280
+ mode = "video"
281
+ publisher = "xAI"
282
+ license = "xAI's terms of service"
283
+ tasks = ["text-to-video", "image-to-video"]
284
+ cloud = "xai"
285
+ api_model = "grok-imagine-video-1.5"
286
+ price = { "480p" = 0.08, "720p" = 0.14, "1080p" = 0.25, input_image = 0.01 }
287
+ priced = "2026-10-24"
288
+ notes = "480p fast, 720p balanced, 1080p best; text or a start image"
@@ -72,6 +72,10 @@ class MediaModel:
72
72
  negative: bool = False # whether it uses a negative prompt
73
73
  edit: str = "" # how it edits images ("reference-latent"), or empty: it doesn't
74
74
  video_workflow: str = "" # a tool's workflow for clips, when it works on them too (upscaling)
75
+ cloud: str = "" # the provider it runs at (lcode.media_cloud.PROVIDERS), or empty: on this machine
76
+ api_model: str = "" # the provider's name for it
77
+ price: dict[str, float] = field(default_factory=dict, hash=False) # dollars: per image, per second at 720p…
78
+ priced: str = "" # when the prices were checked
75
79
 
76
80
  def preset(self, quality: str) -> tuple[int | None, float]:
77
81
  """(steps, megapixels) for a quality preset: None steps keeps the workflow's."""
@@ -86,10 +90,12 @@ class MediaModel:
86
90
  def need_gb(self) -> float:
87
91
  """GPU memory at the peak: measured, or estimated. ComfyUI loads the text encoder, the model and the VAE
88
92
  one after another and moves what it doesn't need off the GPU, so the largest file sets the peak."""
89
- return self.gpu_gb or max(f.gb for f in self.files.values()) + WORKING_GB
93
+ return self.gpu_gb or max((f.gb for f in self.files.values()), default=0.0) + WORKING_GB
90
94
 
91
95
  def fit(self, hw: Hardware) -> tuple[str, str]:
92
- """(fits | slower | too big | cpu, a short note) on this machine."""
96
+ """(fits | slower | too big | cpu | cloud, a short note) on this machine."""
97
+ if self.cloud:
98
+ return "cloud", "runs at the provider: nothing on this machine"
93
99
  weights_gib = self.size_gb * 1e9 / GIB
94
100
  need_gib = self.need_gb * 1e9 / GIB
95
101
  if hw.unified:
@@ -114,18 +120,18 @@ class Catalog:
114
120
  return [m for m in self.models.values() if m.mode == mode]
115
121
 
116
122
  def for_task(self, mode: str, task: str) -> MediaModel | None:
117
- """The first model of a mode that does a task (first-last-frame, camera, image-to-video…)."""
118
- return next((m for m in self.for_mode(mode) if task in m.tasks), None)
123
+ """The first local model of a mode that does a task (first-last-frame, camera, extend…)."""
124
+ return next((m for m in self.for_mode(mode) if task in m.tasks and not m.cloud), None)
119
125
 
120
126
  def tool(self, task: str) -> MediaModel:
121
127
  """The tool for a task (upscale, remove-background)."""
122
128
  return next(m for m in self.models.values() if m.mode == "tool" and task in m.tasks)
123
129
 
124
130
  def editor(self, preferred: MediaModel) -> MediaModel | None:
125
- """A model that edits: the preferred one if it can, else the first image model that can."""
126
- if preferred.edit:
131
+ """A local model that edits: the preferred one if it can, else the first image model that can."""
132
+ if preferred.edit and not preferred.cloud:
127
133
  return preferred
128
- return next((m for m in self.for_mode("image") if m.edit), None)
134
+ return next((m for m in self.for_mode("image") if m.edit and not m.cloud), None)
129
135
 
130
136
  def find(self, wanted: str, mode: str | None = None) -> MediaModel | None:
131
137
  """A model by key or name (any case), or by its number in the mode's list."""
@@ -146,7 +152,7 @@ def load() -> Catalog:
146
152
  models = {}
147
153
  for key, m in data.get("models", {}).items():
148
154
  try:
149
- roles = {role: files[ref] for role, ref in m["files"].items()}
155
+ roles = {role: files[ref] for role, ref in m.get("files", {}).items()}
150
156
  except KeyError as e:
151
157
  raise CatalogError(f"media.toml: {key} uses the file {e}, which isn't listed") from e
152
158
  models[key] = MediaModel(
@@ -156,7 +162,7 @@ def load() -> Catalog:
156
162
  m.get("publisher", ""),
157
163
  m.get("license", ""),
158
164
  tuple(m.get("tasks", ())),
159
- m["workflow"],
165
+ m.get("workflow", ""),
160
166
  roles,
161
167
  float(m.get("gpu_gb", 0.0)),
162
168
  m.get("measured", ""),
@@ -165,6 +171,10 @@ def load() -> Catalog:
165
171
  bool(m.get("negative", False)),
166
172
  m.get("edit", ""),
167
173
  m.get("video_workflow", ""),
174
+ m.get("cloud", ""),
175
+ m.get("api_model", ""),
176
+ {name: float(v) for name, v in (m.get("price") or {}).items()},
177
+ m.get("priced", ""),
168
178
  )
169
179
  return Catalog(files, models)
170
180
 
@@ -307,8 +317,10 @@ def file_sha256(path: Path) -> str:
307
317
  def install(model: MediaModel, server=None, install=None, console=None, ask=None, get=None) -> list[Path]:
308
318
  """Download the model's missing files into ComfyUI's model folders. Raises CatalogError with what to do.
309
319
 
310
- `ask(question) -> bool` confirms the download (None: go ahead, for `--yes`).
320
+ `ask(question) -> bool` confirms the download (None: go ahead, for `--yes`). A cloud model has nothing to install.
311
321
  """
322
+ if model.cloud:
323
+ return []
312
324
  from rich.console import Console
313
325
  from rich.progress import BarColumn, DownloadColumn, Progress, TextColumn, TimeRemainingColumn, TransferSpeedColumn
314
326
 
@@ -346,7 +358,11 @@ def install(model: MediaModel, server=None, install=None, console=None, ask=None
346
358
 
347
359
 
348
360
  def describe(model: MediaModel, hw: Hardware, installed: Installed | None) -> str:
349
- """One line for a list: tasks, size, fit, installed."""
361
+ """One line for a list: tasks, size, fit, installed; for a cloud model, where it runs, its price and the key."""
362
+ if model.cloud:
363
+ from lcode import media_cloud
364
+
365
+ return " · ".join([", ".join(model.tasks), *media_cloud.describe(model)])
350
366
  status, note = model.fit(hw)
351
367
  parts = [", ".join(model.tasks), f"{model.size_gb:.1f} GB"]
352
368
  if installed is not None: