lcode-cli 0.50.0__tar.gz → 0.51.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.
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/CHANGELOG.md +26 -2
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/PKG-INFO +1 -1
- lcode_cli-0.51.0/docs/assets/long-clip-tulip.jpg +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/docs/modes.md +58 -1
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/docs/quickstart.md +1 -1
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/docs/usage.md +3 -3
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/src/lcode/__init__.py +1 -1
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/src/lcode/imageopts.py +2 -1
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/src/lcode/manual.py +3 -3
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/src/lcode/media.py +194 -11
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/src/lcode/media_cloud.py +3 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/src/lcode/repl.py +1 -1
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/src/lcode/update.py +43 -17
- lcode_cli-0.51.0/tests/test_long_clips.py +152 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/tests/test_manual.py +9 -5
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/tests/test_update.py +54 -2
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/tests/test_video.py +2 -2
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/.editorconfig +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/.github/CODEOWNERS +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/.github/ISSUE_TEMPLATE/bug_report.yml +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/.github/ISSUE_TEMPLATE/config.yml +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/.github/ISSUE_TEMPLATE/feature_request.yml +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/.github/ISSUE_TEMPLATE/model_request.yml +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/.github/dependabot.yml +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/.github/workflows/ci.yml +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/.github/workflows/docs.yml +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/.github/workflows/release.yml +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/.gitignore +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/.pre-commit-config.yaml +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/AGENTS.md +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/CODE_OF_CONDUCT.md +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/CONTRIBUTING.md +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/LICENSE +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/README.md +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/SECURITY.md +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/action.yml +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/docs/agents.md +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/docs/assets/demo.svg +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/docs/assets/extra.css +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/docs/assets/film-fox-and-kitten.jpg +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/docs/automation.md +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/docs/bench.md +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/docs/changelog.md +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/docs/commands.md +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/docs/configuration.md +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/docs/contributing.md +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/docs/editors.md +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/docs/git.md +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/docs/hooks.md +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/docs/how-it-works.md +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/docs/index.md +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/docs/installation.md +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/docs/lsp.md +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/docs/mcp.md +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/docs/memory.md +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/docs/models.md +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/docs/sandbox.md +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/docs/search.md +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/docs/servers.md +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/docs/troubleshooting.md +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/examples/README.md +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/examples/api/fix_tests.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/examples/commands/review.md +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/examples/skills/commit-message/SKILL.md +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/examples/skills/commit-message/scripts/staged.sh +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/install.sh +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/mkdocs.yml +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/overrides/main.html +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/pyproject.toml +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/scripts/make_logos.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/scripts/record_demo.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/scripts/social-preview.html +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/src/lcode/__main__.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/src/lcode/acp.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/src/lcode/action.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/src/lcode/agent.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/src/lcode/api.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/src/lcode/assistant.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/src/lcode/backends.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/src/lcode/bench.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/src/lcode/bench_backend.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/src/lcode/bench_runtime.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/src/lcode/catalog.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/src/lcode/checkpoints.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/src/lcode/checks.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/src/lcode/cli.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/src/lcode/clipboard.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/src/lcode/cloud.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/src/lcode/codesearch.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/src/lcode/comfy.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/src/lcode/config.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/src/lcode/context.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/src/lcode/edits.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/src/lcode/escalate.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/src/lcode/extensions.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/src/lcode/film.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/src/lcode/frontmatter.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/src/lcode/gitflow.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/src/lcode/hardware.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/src/lcode/hooks.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/src/lcode/jobs.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/src/lcode/limits.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/src/lcode/lsp.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/src/lcode/matching.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/src/lcode/mcp/__init__.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/src/lcode/mcp/auth.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/src/lcode/mcp/catalog.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/src/lcode/mcp/catalog.toml +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/src/lcode/mcp/client.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/src/lcode/mcp/commands.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/src/lcode/mcp/config.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/src/lcode/mcp/http.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/src/lcode/mcp/manager.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/src/lcode/mcp/protocol.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/src/lcode/mcp/server.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/src/lcode/mcp/stdio.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/src/lcode/media.toml +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/src/lcode/media_catalog.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/src/lcode/memory.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/src/lcode/models.toml +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/src/lcode/modes.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/src/lcode/notify.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/src/lcode/ollama.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/src/lcode/permissions.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/src/lcode/planning.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/src/lcode/preview.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/src/lcode/render.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/src/lcode/repeats.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/src/lcode/repomap.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/src/lcode/residency.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/src/lcode/review.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/src/lcode/sandbox.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/src/lcode/screenshots.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/src/lcode/secretscan.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/src/lcode/servers/__init__.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/src/lcode/servers/encord.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/src/lcode/servers/valohai.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/src/lcode/servers/xai.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/src/lcode/sessions.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/src/lcode/steer.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/src/lcode/subagents.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/src/lcode/tools.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/src/lcode/unreachable.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/src/lcode/vision.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/src/lcode/web.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/src/lcode/workflows/__init__.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/src/lcode/workflows/flux2-klein-4b-t2i.json +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/src/lcode/workflows/remove-background.json +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/src/lcode/workflows/smooth-film.json +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/src/lcode/workflows/sound-stable-audio.json +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/src/lcode/workflows/upscale-esrgan.json +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/src/lcode/workflows/upscale-video-esrgan.json +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/src/lcode/workflows/wan21-fun-camera.json +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/src/lcode/workflows/wan21-vace.json +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/src/lcode/workflows/wan22-fun-inp-5b.json +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/src/lcode/workflows/wan22-ti2v-5b.json +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/src/lcode/workflows/z-image-turbo-t2i.json +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/tests/comfy_standin.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/tests/conftest.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/tests/fake_lsp_server.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/tests/fake_mcp_server.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/tests/test_acp.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/tests/test_action.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/tests/test_agent.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/tests/test_api.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/tests/test_assistant.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/tests/test_backends.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/tests/test_bench.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/tests/test_catalog.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/tests/test_checkpoints.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/tests/test_checks.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/tests/test_cli.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/tests/test_clipboard.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/tests/test_cloud.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/tests/test_codesearch.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/tests/test_comfy.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/tests/test_config.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/tests/test_context.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/tests/test_context_picker.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/tests/test_escalate.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/tests/test_extensions.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/tests/test_film.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/tests/test_gitflow.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/tests/test_gpu_handover.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/tests/test_hooks.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/tests/test_image_edit.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/tests/test_image_generate.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/tests/test_jobs.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/tests/test_look.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/tests/test_lsp.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/tests/test_matching.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/tests/test_mcp.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/tests/test_media_catalog.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/tests/test_media_cloud.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/tests/test_memory.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/tests/test_model_picker.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/tests/test_modes.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/tests/test_permissions.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/tests/test_plan_mode.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/tests/test_repeats.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/tests/test_repomap.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/tests/test_residency.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/tests/test_review.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/tests/test_robustness.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/tests/test_sandbox.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/tests/test_screenshots.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/tests/test_secretscan.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/tests/test_servers.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/tests/test_sessions.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/tests/test_steer.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/tests/test_stuck.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/tests/test_subagents.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/tests/test_tools.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/tests/test_vision.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/tests/test_web.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.0}/tests/test_xai.py +0 -0
- {lcode_cli-0.50.0 → lcode_cli-0.51.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.51.0] - 2026-10-27
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
|
|
13
|
+
- **Clips up to 60 seconds** (#185), also from a start to an end picture: `@start.png @end.png the
|
|
14
|
+
flower opens --seconds 25`. A clip longer than the 8 s a video model makes at once is made in
|
|
15
|
+
parts, each starting on the last frame of the one before (the last one ending on the end
|
|
16
|
+
picture), and joined into one clip with ffmpeg, without the frame each join would repeat.
|
|
17
|
+
`/extend 4 --seconds 20` works the same way; Esc keeps the parts made so far as a clip.
|
|
18
|
+
- **Clips through several pictures:** `@bud.png @half-open.png @open.png the tulip opens
|
|
19
|
+
--seconds 25` goes to each picture in turn, in an equal share of the clip.
|
|
20
|
+
|
|
21
|
+
### Fixed
|
|
22
|
+
|
|
23
|
+
- **`lcode update` ending in `ModuleNotFoundError: No module named 'rich._unicode_data…'`.**
|
|
24
|
+
The update itself had worked; only its last message failed, and the Ollama update after it
|
|
25
|
+
didn't run. Updating lcode can replace the files the running lcode is made of, so lcode now
|
|
26
|
+
prepares what it will say before that and updates Ollama first. A git checkout is reinstalled
|
|
27
|
+
on the Python lcode already runs on. Before, uv picked one from the folder you were in, such
|
|
28
|
+
as a nearby `.venv`, and built a new environment when it was another version. An update runs
|
|
29
|
+
the old version's code, so the update to this version can still show the error once. lcode is
|
|
30
|
+
updated anyway: run `lcode update ollama` for the rest.
|
|
31
|
+
|
|
9
32
|
## [0.50.0] - 2026-10-26
|
|
10
33
|
|
|
11
34
|
### Added
|
|
@@ -17,7 +40,7 @@ All notable changes to lcode are documented here. The format follows
|
|
|
17
40
|
being made into a picture (`--raw` makes it anyway); in code mode, the coding model gets a
|
|
18
41
|
`lcode_help` tool that searches the manual. The prompt assistant's small model answers in image
|
|
19
42
|
and video mode (`qwen3.5:4b`); every command and option in an answer must exist in lcode,
|
|
20
|
-
and the lines to type go through lcode's own option parser (`--seconds
|
|
43
|
+
and the lines to type go through lcode's own option parser (`--seconds 90` is caught), with one
|
|
21
44
|
retry before what's still wrong is marked.
|
|
22
45
|
|
|
23
46
|
## [0.49.1] - 2026-10-26
|
|
@@ -1079,7 +1102,8 @@ First public release.
|
|
|
1079
1102
|
- `AGENTS.md` project instructions and `/init` to generate them.
|
|
1080
1103
|
- One-line installer for Linux and macOS.
|
|
1081
1104
|
|
|
1082
|
-
[Unreleased]: https://github.com/nasser1941/lcode/compare/v0.
|
|
1105
|
+
[Unreleased]: https://github.com/nasser1941/lcode/compare/v0.51.0...HEAD
|
|
1106
|
+
[0.51.0]: https://github.com/nasser1941/lcode/compare/v0.50.0...v0.51.0
|
|
1083
1107
|
[0.50.0]: https://github.com/nasser1941/lcode/compare/v0.49.1...v0.50.0
|
|
1084
1108
|
[0.49.1]: https://github.com/nasser1941/lcode/compare/v0.49.0...v0.49.1
|
|
1085
1109
|
[0.49.0]: https://github.com/nasser1941/lcode/compare/v0.48.0...v0.49.0
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: lcode-cli
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.51.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/
|
|
Binary file
|
|
@@ -153,7 +153,8 @@ video ❯ /play
|
|
|
153
153
|
```
|
|
154
154
|
|
|
155
155
|
- **Options:** the image options work here too (`--n`, `--ar`, `--seed`, `--quality`, `--style`,
|
|
156
|
-
`--no`, and `/options`), plus `--seconds` (1 to
|
|
156
|
+
`--no`, and `/options`), plus `--seconds` (1 to 60; 5 by default, at 24 frames per second;
|
|
157
|
+
longer than 8, it's [made in parts](#longer-clips)).
|
|
157
158
|
Clips are 16:9, or 9:16 from an upright start picture (cropped to it), unless you give a shape:
|
|
158
159
|
Wan 2.2 knows those two shapes best, and a square or small clip can break up into streaks.
|
|
159
160
|
- **Quality:** `fast` makes 864×480 in 12 steps, `balanced` (the default) 864×480 in 20 steps, and
|
|
@@ -176,6 +177,8 @@ video ❯ /play
|
|
|
176
177
|
`tilt-down`, `zoom-in`, `zoom-out`, `dolly-in`, `dolly-out`, `rotate-left`, `rotate-right`,
|
|
177
178
|
`static`), from a description or a start picture. Wan 2.1 Fun Camera 1.3B makes these, at 832×480
|
|
178
179
|
and 16 frames per second: a 3 s move takes about 2 minutes.
|
|
180
|
+
- **Longer clips:** up to 60 seconds, also from a start to an end picture
|
|
181
|
+
(`@start.png @end.png the flower opens --seconds 25`). See [Longer clips](#longer-clips).
|
|
179
182
|
- **Extend a clip:** `/extend 4 --seconds 3 it flies away` continues clip #4 from its last frame
|
|
180
183
|
and joins the new part after it, as one longer clip (`…-extended.mp4`; 3 s more in about a
|
|
181
184
|
minute at `fast`).
|
|
@@ -198,6 +201,60 @@ video ❯ /play
|
|
|
198
201
|
- **Long renders:** progress shows the step and the time left. With `notify` on, lcode sends a
|
|
199
202
|
desktop notification when a clip that took longer than `notify_after` seconds is done.
|
|
200
203
|
|
|
204
|
+
## Longer clips
|
|
205
|
+
|
|
206
|
+
A video model makes up to 8 seconds at once. For a longer clip (`--seconds` up to 60), lcode makes
|
|
207
|
+
it in parts and joins them into one:
|
|
208
|
+
|
|
209
|
+
```text
|
|
210
|
+
video ❯ @start.png @middle.png @end.png the tulip bud slowly opens into a full flower, gentle breeze --seconds 25 --quality fast
|
|
211
|
+
◆ A 25 s clip: lcode makes it in 4 parts of 6.25 s, each going on from the last frame of the one before, and joins them. Parts 2 and 4 each go to your next picture, in order.
|
|
212
|
+
part 1 of 4: 6.25 s, made in 137 s
|
|
213
|
+
part 2 of 4: 6.25 s, made in 141 s
|
|
214
|
+
part 3 of 4: 6.25 s, made in 138 s
|
|
215
|
+
part 4 of 4: 6.25 s, made in 143 s
|
|
216
|
+
◆ #2 .lcode/media/20261026-201311-the-tulip-bud-slowly-opens-into-a-full-f.mp4 864×480 · Wan 2.2 TI2V 5B + Wan 2.2 Fun InP 5B · seed 1496941735 · 561.9 s
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+

|
|
220
|
+
|
|
221
|
+
*Frames at 0, 6, 9.6, 14.6, 21.7 and 25.3 s of that clip, through a bud, a half-open and an open
|
|
222
|
+
tulip: the change comes in steps, with some drift (the light flare at 9.6 s).*
|
|
223
|
+
|
|
224
|
+
- **The parts:**
|
|
225
|
+
- as few as it takes, about equally long;
|
|
226
|
+
- the first comes from your description, or starts from your start picture;
|
|
227
|
+
- each next one starts on the last frame of the one before;
|
|
228
|
+
- with an end picture, the last part goes from there to your end picture (Wan 2.2 Fun InP), so
|
|
229
|
+
the clip ends exactly on it.
|
|
230
|
+
- **Where the change happens:** the change toward a picture happens in the part that ends on it.
|
|
231
|
+
With only a start and an end picture, the clip goes on from the start for most of its length
|
|
232
|
+
and reaches the end picture in its last part. On a tulip opening over 25 s, it stayed closed for
|
|
233
|
+
about 20 s and then opened within 2. Making the whole change once as a guide clip doesn't help:
|
|
234
|
+
Wan 2.2 Fun InP opens the tulip within its first frames, at `fast` and at `balanced`.
|
|
235
|
+
- **Pictures along the way:** for a change in steps, give more pictures, in order:
|
|
236
|
+
`@bud.png @half-open.png @open.png the tulip opens --seconds 25`. The clip gets an equal share
|
|
237
|
+
for each picture after the first, and the part that ends each share goes to that picture. Three
|
|
238
|
+
or more pictures work in a short clip too, one part to each.
|
|
239
|
+
- **One clip:** ffmpeg joins the parts, leaving out the frame each join would show twice, at the
|
|
240
|
+
first part's pace and size. It's numbered in the gallery like any clip. Its JSON lists the parts,
|
|
241
|
+
which stay in a `…-parts` folder next to it.
|
|
242
|
+
- **Extending:** `/extend 4 --seconds 20 it flies away` adds 20 s to clip #4 the same way.
|
|
243
|
+
- **Follow-ups work as for any clip:** `/again`, `/vary` and `/play`, and `/upscale`, `/smooth`
|
|
244
|
+
and `/sound` on the result.
|
|
245
|
+
- **Esc** stops it. The parts made so far are joined into a `…-partial.mp4` clip in the gallery.
|
|
246
|
+
- **Needs** ffmpeg (`apt install ffmpeg`, `brew install ffmpeg`).
|
|
247
|
+
- **Before it starts,** lcode says how many parts it makes. After a clip in the same session, it
|
|
248
|
+
also says about how long it takes, at that clip's pace.
|
|
249
|
+
- **What to expect:** each part follows the same description, so a long clip has the same action
|
|
250
|
+
throughout, slowly drifting; for a story with scenes, make a [film](#films). Grok Imagine makes
|
|
251
|
+
up to 15 s at once: a longer clip is made on your GPU.
|
|
252
|
+
|
|
253
|
+
- **Measured** on the RTX 4080 Laptop GPU (12 GB), a 25 s clip from a start to an end picture
|
|
254
|
+
(4 parts of 6.25 s, 864×480, 609 frames at 24 fps): 9.4 minutes at `fast` (about 140 s a part)
|
|
255
|
+
and 14.2 minutes at `balanced` (about 210 s a part). Through three pictures at `fast`: 9.4
|
|
256
|
+
minutes. The joins don't show: the frames on either side of each one match.
|
|
257
|
+
|
|
201
258
|
## Films
|
|
202
259
|
|
|
203
260
|
From one idea, lcode makes a short film with the same characters in every shot:
|
|
@@ -131,8 +131,8 @@ image ❯ /upscale 3 4
|
|
|
131
131
|
(the [prompt assistant](modes.md#the-prompt-assistant)'s: `qwen3.5:4b` or the model you chose), loaded only for the
|
|
132
132
|
answer so the GPU stays with ComfyUI. Without one, lcode shows the parts of the manual that match.
|
|
133
133
|
- **Checked by lcode itself:** every command and option in an answer must exist in lcode, and the
|
|
134
|
-
lines to type go through lcode's own option parser: `--seconds
|
|
135
|
-
a video is: 1 to
|
|
134
|
+
lines to type go through lcode's own option parser: `--seconds 90` is caught ("seconds is how long
|
|
135
|
+
a video is: 1 to 60"). An answer that fails a check is asked for again once; what still fails is
|
|
136
136
|
marked with ⚠, and isn't typed in for you.
|
|
137
137
|
|
|
138
138
|
**Measured** on an RTX 4080 Laptop GPU (12 GB): 15 everyday questions (a 25-second clip between two
|
|
@@ -146,7 +146,7 @@ the context window…), each answer scored by hand:
|
|
|
146
146
|
| `qwen3.6-35b` (code mode) | 12 | 2 | 1 (marked ⚠) | 6 to 7 s, once loaded |
|
|
147
147
|
|
|
148
148
|
The checks caught every command that doesn't exist (`/image`, `/grok-video`, `/lcode`); before them,
|
|
149
|
-
the small models answered
|
|
149
|
+
the small models answered `/image …` without a warning. What's left: an extra
|
|
150
150
|
or out-of-order step now and then, and an odd claim in the sentences after the commands.
|
|
151
151
|
|
|
152
152
|
## What the model can do
|
|
@@ -13,7 +13,8 @@ from dataclasses import asdict, dataclass, replace
|
|
|
13
13
|
|
|
14
14
|
QUALITIES = ("fast", "balanced", "best")
|
|
15
15
|
MAX_COUNT = 8
|
|
16
|
-
MAX_SECONDS =
|
|
16
|
+
MAX_SECONDS = 60 # video: a clip longer than a part is made in parts and joined (lcode.media.long_clip)
|
|
17
|
+
PART_SECONDS = 8 # what a video model makes at once: longer needs more memory than a laptop GPU has, and models drift
|
|
17
18
|
SIZES = { # names for aspect ratios
|
|
18
19
|
"square": "1:1",
|
|
19
20
|
"portrait": "3:4",
|
|
@@ -392,7 +392,7 @@ def is_question(text: str) -> bool:
|
|
|
392
392
|
# What a model needs to know to read the manual right: how requests work in each mode (tests check that every
|
|
393
393
|
# command and option here exists).
|
|
394
394
|
BASICS = """- Image mode (/mode image): what the user types at the prompt is a description, and lcode makes pictures from it. There is no command for that (no /image, /imagine or /generate). Options go after the description, for example: a red fox in the snow --n 4 --ar 16:9 (--n: 1 to 8 pictures; --ar: the shape; also --seed, --quality fast|balanced|best, --style, --no). @photo.png in a request uses the user's picture, to edit or as a reference. Results are numbered in the session's gallery (#1, #2…), and follow-ups take the number: /upscale 3, /nobg 3, /edit 3 make the sky purple, /vary 3, /use 3, /animate 3. Files go to .lcode/media/ in the project.
|
|
395
|
-
- Video mode (/mode video): what the user types is a description of a clip, and lcode makes it. There is no /video command. A clip is 1 to
|
|
395
|
+
- Video mode (/mode video): what the user types is a description of a clip, and lcode makes it. There is no /video command. A clip is 1 to 60 seconds (--seconds): longer than 8, lcode makes it in parts and joins them into one clip. @start.png in the request starts the clip from that picture; @start.png @end.png goes from the first picture to the second, also in a long clip (it ends on the second picture). Other options: --camera zoom-in (and other moves), --quality, --n, --ar, --seed, --style, --no. Follow-ups take the clip's number: /extend 4 --seconds 3 (continues it; up to 60 s), /sound 4, /smooth 4, /upscale 4, /play 4. /film makes a short film of several shots, with the same characters, from one idea.
|
|
396
396
|
- Code mode (/mode code, the default): the user asks a coding agent to work on their project. Slash commands control lcode itself (/model, /context, /resume, /undo…), and lcode config set NAME VALUE, in a shell, changes a setting for good."""
|
|
397
397
|
GUIDE = """You are the built-in help of lcode, a terminal program with three modes: code (a coding agent), image and video (they make pictures and clips on the user's GPU). The user is in {mode} mode now. Answer their question about lcode from what's below, and from nothing else.
|
|
398
398
|
|
|
@@ -425,7 +425,7 @@ EXTEND_PADS = {"left", "right", "top", "bottom"}
|
|
|
425
425
|
PICTURE = re.compile(r'(?<!\S)@(?:"[^"]+"|\S+)')
|
|
426
426
|
NUMBER = re.compile(r"^#?\d+$")
|
|
427
427
|
OUTPUT_MARKS = ("◆", "✎", "⚠", "⎿", "●", "▀", "╭", "│", "╰", "…")
|
|
428
|
-
PROMPT_MARK = re.compile(r"^\s*(?:(?:\w+\s*)?❯\s*|(?:code|image|video)\s+(
|
|
428
|
+
PROMPT_MARK = re.compile(r"^\s*(?:(?:\w+\s*)?❯\s*|(?:code|image|video)\s+(?=[/@]))") # a prompt shown before the line
|
|
429
429
|
NO_SLASH = re.compile(
|
|
430
430
|
r"^(mode (code|image|video)|models?\b|(upscale|nobg|vary|play|open|animate|extend|sound|smooth|edit|restyle) #?\d+)\b"
|
|
431
431
|
) # a command without its slash
|
|
@@ -471,7 +471,7 @@ def mode_problem(command: str, mode: str) -> str:
|
|
|
471
471
|
|
|
472
472
|
def problems(text: str, mode: str, manual: Manual) -> list[str]:
|
|
473
473
|
"""What in an answer wouldn't work in lcode: commands or options it doesn't have (anywhere in the text), and lines
|
|
474
|
-
to type that its own parsers reject (--seconds
|
|
474
|
+
to type that its own parsers reject (--seconds 90: "seconds is how long a video is: 1 to 60")."""
|
|
475
475
|
found = [f"lcode has no {name}" for name in manual.unknown(text)]
|
|
476
476
|
current = mode
|
|
477
477
|
for line in typed_lines(text):
|
|
@@ -7,6 +7,7 @@ makes what it can at its provider instead, after showing the cost (lcode.media_c
|
|
|
7
7
|
from __future__ import annotations
|
|
8
8
|
|
|
9
9
|
import json
|
|
10
|
+
import math
|
|
10
11
|
import os
|
|
11
12
|
import random
|
|
12
13
|
import re
|
|
@@ -313,7 +314,7 @@ def request(
|
|
|
313
314
|
raise MediaError("Video mode doesn't take a mask: @photo.png starts a video from a picture.")
|
|
314
315
|
if as_references and not sources:
|
|
315
316
|
raise MediaError("--ref makes the @pictures references: @cat.png @hat.png --ref the cat wears the hat")
|
|
316
|
-
frames = [] if as_references else [str(p) for p in sources
|
|
317
|
+
frames = [] if as_references else [str(p) for p in sources] # 3 or more: the clip goes through them
|
|
317
318
|
refs = [str(p) for p in sources] if as_references else []
|
|
318
319
|
job = {"kind": "video", "prompt": prompt, "options": options, "sources": frames, "mask": None, "pads": None,
|
|
319
320
|
"keep_shape": not SIZE_FLAG.search(text), "refs": refs, "raw": raw} # fmt: skip
|
|
@@ -359,6 +360,12 @@ def redo(
|
|
|
359
360
|
one = replace(options, seed=seed, n=1)
|
|
360
361
|
if job["kind"] == "image":
|
|
361
362
|
made.append(generate_image(agent, prompt, cancelled, ask, one, label, job.get("expanded", "")))
|
|
363
|
+
elif (
|
|
364
|
+
job["kind"] == "video"
|
|
365
|
+
and not job.get("restyle")
|
|
366
|
+
and (one.seconds > imageopts.PART_SECONDS or len(job.get("sources") or []) > 2)
|
|
367
|
+
): # longer than a model makes at once, or through more than two pictures
|
|
368
|
+
made.append(long_clip(agent, job, one, cancelled, ask, label))
|
|
362
369
|
elif job["kind"] == "video":
|
|
363
370
|
made.append(generate_video(agent, job, one, cancelled, ask, label))
|
|
364
371
|
else:
|
|
@@ -487,6 +494,8 @@ class Plan:
|
|
|
487
494
|
sources: list[str] = field(default_factory=list)
|
|
488
495
|
job: dict = field(default_factory=dict) # what made it, for /vary (prompt, sources, mask, pads)
|
|
489
496
|
stem: str = "" # the file name without its extension, when not the time and the prompt
|
|
497
|
+
into: Path | None = None # the folder for its files, when not the media folder
|
|
498
|
+
part: bool = False # a part of a long clip: saved, not numbered or shown (long_clip joins the parts)
|
|
490
499
|
|
|
491
500
|
|
|
492
501
|
def prepare(agent: Agent, ask, cancelled) -> comfy.Server:
|
|
@@ -611,9 +620,11 @@ def generate_video(
|
|
|
611
620
|
cancelled: Callable[[], bool] = lambda: False,
|
|
612
621
|
ask: Callable[[str], bool] | None = None,
|
|
613
622
|
label: str = "",
|
|
623
|
+
part: tuple[Path, str] | None = None,
|
|
614
624
|
) -> Made:
|
|
615
625
|
"""One video: from the prompt, or starting from the job's image. Its shape is 16:9, or 9:16 for an upright start
|
|
616
|
-
image (the shapes video models know best; the image is cropped to it), unless the request gives one.
|
|
626
|
+
image (the shapes video models know best; the image is cropped to it), unless the request gives one. A part of a
|
|
627
|
+
long clip (`part`: its folder and name) is saved there, without a number in the gallery."""
|
|
617
628
|
prompt = job["prompt"].strip()
|
|
618
629
|
server = prepare(agent, ask, cancelled)
|
|
619
630
|
sources = [Path(p) for p in job.get("sources") or []]
|
|
@@ -626,7 +637,7 @@ def generate_video(
|
|
|
626
637
|
"restyle" if restyle else "references" if refs else "first-last-frame" if end
|
|
627
638
|
else "camera" if options.camera else "extend" if clip else ""
|
|
628
639
|
) # fmt: skip
|
|
629
|
-
model = video_model(agent, task)
|
|
640
|
+
model = video_model(agent, task, quiet=part is not None)
|
|
630
641
|
files = ensure_installed(agent, model, server, ask)
|
|
631
642
|
workflow = comfy.load_workflow(model.workflow)
|
|
632
643
|
seed = options.seed if options.seed is not None else random.randrange(2**32)
|
|
@@ -694,7 +705,7 @@ def generate_video(
|
|
|
694
705
|
remembered = {k: job.get(k) for k in keys}
|
|
695
706
|
stem = f"{clip.stem}-extended" if clip else (f"{restyle.stem}-restyled" if restyle else "")
|
|
696
707
|
plan = Plan(model, workflow, graph, meta, prompt, seed, options, "video", job.get("sources") or [], remembered,
|
|
697
|
-
stem) # fmt: skip
|
|
708
|
+
part[1] if part else stem, part[0] if part else None, part is not None) # fmt: skip
|
|
698
709
|
return run_plan(agent, server, plan, cancelled, label)
|
|
699
710
|
|
|
700
711
|
|
|
@@ -745,8 +756,9 @@ def control_from(graph: dict, clip_name: str, length: int) -> list:
|
|
|
745
756
|
return ["8404", 0]
|
|
746
757
|
|
|
747
758
|
|
|
748
|
-
def video_model(agent: Agent, task: str) -> catalog.MediaModel:
|
|
749
|
-
"""The video model for a job: the chosen one, or the first local one that does what the job needs
|
|
759
|
+
def video_model(agent: Agent, task: str, quiet: bool = False) -> catalog.MediaModel:
|
|
760
|
+
"""The video model for a job: the chosen one, or the first local one that does what the job needs (said, unless
|
|
761
|
+
`quiet`: the parts of a long clip)."""
|
|
750
762
|
chosen = current(agent, "video")
|
|
751
763
|
if not chosen.cloud and (not task or task in chosen.tasks):
|
|
752
764
|
return chosen
|
|
@@ -754,7 +766,8 @@ def video_model(agent: Agent, task: str) -> catalog.MediaModel:
|
|
|
754
766
|
if model is None:
|
|
755
767
|
raise MediaError(f"None of lcode's video models does {WHY.get(task, task)} yet.")
|
|
756
768
|
where = f"; {chosen.name} doesn't do that here" if chosen.cloud else ""
|
|
757
|
-
|
|
769
|
+
if not quiet:
|
|
770
|
+
agent.say(f"{model.name} makes this one ({WHY.get(task, task)}{where}).")
|
|
758
771
|
return model
|
|
759
772
|
|
|
760
773
|
|
|
@@ -771,7 +784,173 @@ def continue_clip(graph: dict, latent: str, clip_name: str, length: int) -> None
|
|
|
771
784
|
graph[video]["inputs"]["images"] = ["8204", 0]
|
|
772
785
|
|
|
773
786
|
|
|
787
|
+
def parts_of(total: float, longest: float = imageopts.PART_SECONDS) -> list[float]:
|
|
788
|
+
"""How long each part of a long clip is: as few parts as it takes, about equally long (in quarter seconds)."""
|
|
789
|
+
quarters = max(4, round(total * 4))
|
|
790
|
+
count = max(1, math.ceil(quarters / (longest * 4)))
|
|
791
|
+
base, extra = divmod(quarters, count)
|
|
792
|
+
return [(base + (1 if k < extra else 0)) / 4 for k in range(count)]
|
|
793
|
+
|
|
794
|
+
|
|
795
|
+
def plan_parts(total: float, stops: int) -> list[tuple[float, int | None]]:
|
|
796
|
+
"""A long clip's parts, as (seconds, the picture it ends on or None). With `stops` pictures to reach after the
|
|
797
|
+
start one, each gets an equal share of the clip, made in as few parts as fit; the last of them ends on it."""
|
|
798
|
+
if not stops:
|
|
799
|
+
return [(seconds, None) for seconds in parts_of(total)]
|
|
800
|
+
if total < stops:
|
|
801
|
+
raise MediaError(f"{stops + 1} pictures need a clip of at least {stops} s: --seconds {stops} or more.")
|
|
802
|
+
out: list[tuple[float, int | None]] = []
|
|
803
|
+
for stop in range(1, stops + 1):
|
|
804
|
+
lengths = parts_of(total / stops)
|
|
805
|
+
out += [(seconds, None) for seconds in lengths[:-1]] + [(lengths[-1], stop)]
|
|
806
|
+
return out
|
|
807
|
+
|
|
808
|
+
|
|
809
|
+
def long_clip(
|
|
810
|
+
agent: Agent,
|
|
811
|
+
job: dict,
|
|
812
|
+
options: imageopts.Options,
|
|
813
|
+
cancelled: Callable[[], bool] = lambda: False,
|
|
814
|
+
ask: Callable[[str], bool] | None = None,
|
|
815
|
+
label: str = "",
|
|
816
|
+
) -> Made:
|
|
817
|
+
"""A clip longer than a video model makes at once: made in parts, each going on from the last frame of the one
|
|
818
|
+
before (and the last one ending on the end picture, when there is one), then joined into one clip with ffmpeg.
|
|
819
|
+
Esc keeps what's made: the parts so far, joined."""
|
|
820
|
+
ffmpeg = shutil.which("ffmpeg")
|
|
821
|
+
if not ffmpeg:
|
|
822
|
+
raise MediaError(
|
|
823
|
+
f"A clip longer than {imageopts.PART_SECONDS} s is made in parts and joined with ffmpeg: install it "
|
|
824
|
+
f"(apt install ffmpeg, brew install ffmpeg), or ask for {imageopts.PART_SECONDS} s or less."
|
|
825
|
+
)
|
|
826
|
+
pictures = [Path(p) for p in job.get("sources") or []]
|
|
827
|
+
plan = plan_parts(options.seconds, max(0, len(pictures) - 1))
|
|
828
|
+
lengths = [seconds for seconds, _ in plan]
|
|
829
|
+
chosen = current(agent, "video")
|
|
830
|
+
if chosen.cloud:
|
|
831
|
+
agent.say(
|
|
832
|
+
f"{chosen.name} makes clips of up to {media_cloud.MAX_VIDEO_SECONDS} s: this one is made on your GPU."
|
|
833
|
+
)
|
|
834
|
+
clip = Path(job["extend"]) if job.get("extend") else None
|
|
835
|
+
seed = options.seed if options.seed is not None else random.randrange(2**32)
|
|
836
|
+
stem = f"{clip.stem}-extended" if clip else f"{time.strftime('%Y%m%d-%H%M%S')}-{comfy.slug(job['prompt'])}"
|
|
837
|
+
work = comfy.unique(folder(agent) / f"{stem}-parts")
|
|
838
|
+
say_plan(agent, options.seconds, plan, len(pictures), clip is not None)
|
|
839
|
+
started = time.monotonic()
|
|
840
|
+
frame = last_frame(ffmpeg, clip, work / "00-last.png") if clip else (pictures[0] if pictures else None)
|
|
841
|
+
size = f"{job['size'][0]}x{job['size'][1]}" if clip and job.get("size") else ""
|
|
842
|
+
made: list[Made] = []
|
|
843
|
+
try:
|
|
844
|
+
for k, (seconds, stop) in enumerate(plan):
|
|
845
|
+
if k and cancelled(): # Esc between two parts: the next one isn't started
|
|
846
|
+
raise MediaError("Cancelled before the next part.")
|
|
847
|
+
part = {**job, "extend": None, "restyle": None, "size": None,
|
|
848
|
+
"sources": [str(frame)] if frame else [],
|
|
849
|
+
"refs": job.get("refs") if k == 0 and not clip else [],
|
|
850
|
+
"keep_shape": not size and job.get("keep_shape", True)} # fmt: skip
|
|
851
|
+
if stop is not None: # this part ends on the next picture
|
|
852
|
+
part["sources"] = [str(frame), str(pictures[stop])]
|
|
853
|
+
one = replace(options, seconds=seconds, seed=seed + k, size=size or options.size)
|
|
854
|
+
name = f"part {k + 1} of {len(plan)}" + (f", {label}" if label else "")
|
|
855
|
+
made.append(generate_video(agent, part, one, cancelled, ask, name, (work, f"{k + 1:02d}")))
|
|
856
|
+
agent.console.print(Text(f" part {k + 1} of {len(plan)}: {seconds:g} s, made in "
|
|
857
|
+
f"{made[-1].seconds:.0f} s", style="dim")) # fmt: skip
|
|
858
|
+
frame = last_frame(ffmpeg, made[-1].files[0], work / f"{k + 1:02d}-last.png")
|
|
859
|
+
except MediaError as e:
|
|
860
|
+
if not made:
|
|
861
|
+
raise
|
|
862
|
+
if not str(e).startswith("Cancelled"):
|
|
863
|
+
raise MediaError(f"{e} The parts made so far are in {shown(agent, work)}.") from e
|
|
864
|
+
result = join_long(agent, ffmpeg, job, options, made, lengths, seed, clip, f"{stem}-partial", started, work)
|
|
865
|
+
agent.console.print(f"[yellow]⏹ Stopped after part {len(made)} of {len(lengths)}: what's made is "
|
|
866
|
+
f"#{result.numbers[0]}.[/]") # fmt: skip
|
|
867
|
+
return result
|
|
868
|
+
return join_long(agent, ffmpeg, job, options, made, lengths, seed, clip, stem, started, work)
|
|
869
|
+
|
|
870
|
+
|
|
871
|
+
def say_plan(agent: Agent, total: float, plan: list[tuple[float, int | None]], pictures: int, extends: bool) -> None:
|
|
872
|
+
"""What a long clip takes, before it starts: its parts, which end on a picture, and about how long (at the pace
|
|
873
|
+
of this session's last clip)."""
|
|
874
|
+
lengths = [seconds for seconds, _ in plan]
|
|
875
|
+
each = f"{lengths[0]:g}" if len(set(lengths)) == 1 else f"{min(lengths):g} to {max(lengths):g}"
|
|
876
|
+
what = f"{total:g} s more" if extends else f"A {total:g} s clip"
|
|
877
|
+
line = (f"{what}: lcode makes it in {len(plan)} parts of {each} s, each going on from the last frame of the one "
|
|
878
|
+
"before, and joins them.") # fmt: skip
|
|
879
|
+
stops = [k + 1 for k, (_, stop) in enumerate(plan) if stop is not None]
|
|
880
|
+
if pictures == 2:
|
|
881
|
+
line += f" Part {stops[0]} goes to your end picture: the change toward it happens there."
|
|
882
|
+
elif pictures > 2:
|
|
883
|
+
named = ", ".join(str(n) for n in stops[:-1]) + f" and {stops[-1]}"
|
|
884
|
+
line += f" Parts {named} each go to your next picture, in order."
|
|
885
|
+
pace = [r["seconds"] / max(r["options"].get("seconds") or 5, 1) for r in agent.media_results
|
|
886
|
+
if r.get("kind") == "video" and isinstance(r.get("options"), dict)] # fmt: skip
|
|
887
|
+
if pace:
|
|
888
|
+
line += f" About {max(1, round(pace[-1] * total / 60))} min, at the pace of your last clip."
|
|
889
|
+
agent.say(line)
|
|
890
|
+
|
|
891
|
+
|
|
892
|
+
def last_frame(ffmpeg: str, clip: Path, out: Path) -> Path:
|
|
893
|
+
"""A clip's last frame, as a picture: where its next part starts."""
|
|
894
|
+
out.parent.mkdir(parents=True, exist_ok=True)
|
|
895
|
+
done = subprocess.run([ffmpeg, "-y", "-v", "error", "-sseof", "-1", "-i", str(clip), "-update", "1", str(out)],
|
|
896
|
+
capture_output=True, text=True, stdin=subprocess.DEVNULL) # fmt: skip
|
|
897
|
+
if done.returncode != 0 or not out.exists():
|
|
898
|
+
raise MediaError(f"ffmpeg couldn't read the last frame of {clip.name}: {done.stderr.strip()[-300:]}")
|
|
899
|
+
return out
|
|
900
|
+
|
|
901
|
+
|
|
902
|
+
def join_command(ffmpeg: str, clips: list[Path], out: Path, fps: float, width: int, height: int) -> list[str]:
|
|
903
|
+
"""ffmpeg's command for one clip from its parts: each after the first starts on the frame the one before ended
|
|
904
|
+
on, so that frame is left out; all at the first part's pace and size."""
|
|
905
|
+
command = [ffmpeg, "-y", "-v", "error"]
|
|
906
|
+
chains = []
|
|
907
|
+
for k, clip in enumerate(clips):
|
|
908
|
+
command += ["-i", str(clip)]
|
|
909
|
+
steps = (["trim=start_frame=1", "setpts=PTS-STARTPTS"] if k else []) + [
|
|
910
|
+
f"fps={fps:g}", f"scale={width}:{height}:flags=lanczos", "setsar=1"] # fmt: skip
|
|
911
|
+
chains.append(f"[{k}:v]{','.join(steps)}[p{k}]")
|
|
912
|
+
joined = "".join(f"[p{k}]" for k in range(len(clips))) + f"concat=n={len(clips)}:v=1:a=0[out]"
|
|
913
|
+
return [*command, "-filter_complex", ";".join([*chains, joined]), "-map", "[out]", "-c:v", "libx264",
|
|
914
|
+
"-crf", "17", "-pix_fmt", "yuv420p", "-movflags", "+faststart", str(out)] # fmt: skip
|
|
915
|
+
|
|
916
|
+
|
|
917
|
+
def join_long(agent, ffmpeg, job, options, made, lengths, seed, clip, stem, started, work) -> Made:
|
|
918
|
+
"""The parts (after the clip they extend, if any) joined into one clip, numbered in the gallery and shown."""
|
|
919
|
+
parts = [m.files[0] for m in made]
|
|
920
|
+
pictures = job.get("sources") or []
|
|
921
|
+
first = clip_info(clip or parts[0])
|
|
922
|
+
width, height = (first["width"] or made[0].width), (first["height"] or made[0].height)
|
|
923
|
+
fps = first["fps"] or 24
|
|
924
|
+
out = comfy.unique(folder(agent) / f"{stem}.mp4")
|
|
925
|
+
with agent.console.status("Joining the parts…", spinner="dots"):
|
|
926
|
+
done = subprocess.run(join_command(ffmpeg, ([clip] if clip else []) + parts, out, fps, width, height),
|
|
927
|
+
capture_output=True, text=True, stdin=subprocess.DEVNULL) # fmt: skip
|
|
928
|
+
if done.returncode != 0:
|
|
929
|
+
raise MediaError(f"ffmpeg couldn't join the parts (in {shown(agent, work)}): {done.stderr.strip()[-400:]}")
|
|
930
|
+
models = " + ".join(dict.fromkeys(m.model for m in made))
|
|
931
|
+
seconds = mp4_seconds(out) or sum(lengths[: len(made)])
|
|
932
|
+
meta = {"model": models, "prompt": job["prompt"], "seed": seed, "width": width, "height": height,
|
|
933
|
+
"fps": fps, "seconds": round(seconds, 2), "frames": round(seconds * fps),
|
|
934
|
+
"start_image": shown(agent, Path(pictures[0])) if pictures else "",
|
|
935
|
+
"end_image": shown(agent, Path(pictures[-1])) if len(pictures) > 1 else "",
|
|
936
|
+
"pictures": [shown(agent, Path(p)) for p in pictures] if len(pictures) > 2 else [],
|
|
937
|
+
"extends": shown(agent, clip) if clip else "", "camera": options.camera,
|
|
938
|
+
"parts": [{"file": shown(agent, m.files[0]), "seconds": s, "model": m.model, "seed": m.seed}
|
|
939
|
+
for m, s in zip(made, lengths, strict=False)],
|
|
940
|
+
"file": out.name} # fmt: skip
|
|
941
|
+
out.with_suffix(".json").write_text(json.dumps(meta, indent=2, ensure_ascii=False) + "\n")
|
|
942
|
+
one = Made([out], models, seed, width, height, time.monotonic() - started, job["prompt"])
|
|
943
|
+
one.thumbnail, one.poster = made[0].thumbnail, made[0].poster
|
|
944
|
+
keys = ("kind", "prompt", "sources", "mask", "pads", "keep_shape", "extend", "size", "refs", "restyle")
|
|
945
|
+
plan = Plan(None, None, {}, meta, job["prompt"], seed, options, "video", job.get("sources") or [],
|
|
946
|
+
{k: job.get(k) for k in keys}, stem) # fmt: skip
|
|
947
|
+
one.numbers = record(agent, one, plan)
|
|
948
|
+
show(agent, one)
|
|
949
|
+
return one
|
|
950
|
+
|
|
951
|
+
|
|
774
952
|
VIDEO_TYPES = (".mp4", ".webm", ".mkv", ".mov")
|
|
953
|
+
SOUND_SECONDS = 47.0 # the longest sound Stable Audio Open makes
|
|
775
954
|
TOOL_NAMES = {"upscale": "upscaled", "remove-background": "nobg", "interpolate": "smooth", "sound": "sound"}
|
|
776
955
|
|
|
777
956
|
|
|
@@ -870,7 +1049,10 @@ def apply_tool(
|
|
|
870
1049
|
values["multiplier"], values["fps"] = scale, info["fps"] * scale
|
|
871
1050
|
elif task == "sound":
|
|
872
1051
|
seed = random.randrange(2**32)
|
|
873
|
-
|
|
1052
|
+
seconds = min(SOUND_SECONDS, max(1.0, info["seconds"]))
|
|
1053
|
+
if info["seconds"] > SOUND_SECONDS:
|
|
1054
|
+
agent.say(f"Stable Audio Open makes up to {SOUND_SECONDS:g} s of sound: the rest of the clip is silent.")
|
|
1055
|
+
values.update({"prompt": prompt.strip(), "seed": seed, "seconds": seconds})
|
|
874
1056
|
graph = comfy.fill(workflow.graph, values)
|
|
875
1057
|
add_thumbnail(graph, width, height)
|
|
876
1058
|
what = {
|
|
@@ -935,7 +1117,7 @@ def describe_job(model, workflow, prompt, text, seed, values, options, files) ->
|
|
|
935
1117
|
|
|
936
1118
|
def run_plan(agent: Agent, server: comfy.Server, plan: Plan, cancelled, label: str) -> Made:
|
|
937
1119
|
"""Queue the plan, follow it, save what it made, number it, show it."""
|
|
938
|
-
out = folder(agent)
|
|
1120
|
+
out = plan.into or folder(agent)
|
|
939
1121
|
check_disk(agent, out)
|
|
940
1122
|
free_gpu(agent)
|
|
941
1123
|
stem = plan.stem or f"{time.strftime('%Y%m%d-%H%M%S')}-{comfy.slug(plan.prompt)}"
|
|
@@ -986,8 +1168,9 @@ def run_plan(agent: Agent, server: comfy.Server, plan: Plan, cancelled, label: s
|
|
|
986
1168
|
made.thumbnail = thumbnail(server, outputs)
|
|
987
1169
|
if plan.kind == "video":
|
|
988
1170
|
made.poster = thumbnail(server, outputs, POSTER_NODES[1])
|
|
989
|
-
|
|
990
|
-
|
|
1171
|
+
if not plan.part:
|
|
1172
|
+
made.numbers = record(agent, made, plan)
|
|
1173
|
+
show(agent, made)
|
|
991
1174
|
return made
|
|
992
1175
|
|
|
993
1176
|
|
|
@@ -132,6 +132,9 @@ def cannot(model: catalog.MediaModel, job: dict) -> str:
|
|
|
132
132
|
if len(sources) > 1:
|
|
133
133
|
return "several pictures at once"
|
|
134
134
|
elif kind == "video":
|
|
135
|
+
options = job.get("options")
|
|
136
|
+
if options is not None and options.seconds > MAX_VIDEO_SECONDS:
|
|
137
|
+
return f"clips longer than {MAX_VIDEO_SECONDS} s"
|
|
135
138
|
if job.get("extend"):
|
|
136
139
|
return "extending a clip"
|
|
137
140
|
if job.get("restyle"):
|
|
@@ -88,7 +88,7 @@ COMMANDS = {
|
|
|
88
88
|
"/open": "Open an image in your viewer, e.g. /open 3 (default: the last)",
|
|
89
89
|
"/edit": "Image mode: change an image by instruction, e.g. /edit 3 make the sky purple (@photo.png: references)",
|
|
90
90
|
"/use": "Image mode: images the next requests follow, e.g. /use 3 or /use photo.png (/use off)",
|
|
91
|
-
"/extend": "Outpaint an image (/extend 3 --ar 16:9), or continue a clip in video mode (/extend 4 --seconds
|
|
91
|
+
"/extend": "Outpaint an image (/extend 3 --ar 16:9), or continue a clip in video mode (/extend 4 --seconds 20)",
|
|
92
92
|
"/upscale": "2 or 4 times the pixels of an image or a clip, e.g. /upscale 3 4",
|
|
93
93
|
"/nobg": "Image mode: remove the background (a transparent PNG), e.g. /nobg 3",
|
|
94
94
|
"/animate": "Image mode: make a video starting from an image, e.g. /animate 3 the waves roll in (video mode)",
|