imagen-cli 0.1.1__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 (257) hide show
  1. imagen_cli-0.1.1/.gitignore +30 -0
  2. imagen_cli-0.1.1/LICENSE +21 -0
  3. imagen_cli-0.1.1/PKG-INFO +586 -0
  4. imagen_cli-0.1.1/README.en.md +5 -0
  5. imagen_cli-0.1.1/README.md +544 -0
  6. imagen_cli-0.1.1/README.zh-CN.md +516 -0
  7. imagen_cli-0.1.1/pyproject.toml +80 -0
  8. imagen_cli-0.1.1/src/imagen_cli/__init__.py +0 -0
  9. imagen_cli-0.1.1/src/imagen_cli/__main__.py +3 -0
  10. imagen_cli-0.1.1/src/imagen_cli/application/approval_service.py +36 -0
  11. imagen_cli-0.1.1/src/imagen_cli/application/artifact_service.py +97 -0
  12. imagen_cli-0.1.1/src/imagen_cli/application/batch_service.py +190 -0
  13. imagen_cli-0.1.1/src/imagen_cli/application/batch_summary.py +66 -0
  14. imagen_cli-0.1.1/src/imagen_cli/application/cache_service.py +262 -0
  15. imagen_cli-0.1.1/src/imagen_cli/application/cancel_service.py +91 -0
  16. imagen_cli-0.1.1/src/imagen_cli/application/cleanup_service.py +161 -0
  17. imagen_cli-0.1.1/src/imagen_cli/application/container.py +786 -0
  18. imagen_cli-0.1.1/src/imagen_cli/application/cost_service.py +25 -0
  19. imagen_cli-0.1.1/src/imagen_cli/application/execution_service.py +177 -0
  20. imagen_cli-0.1.1/src/imagen_cli/application/export_service.py +339 -0
  21. imagen_cli-0.1.1/src/imagen_cli/application/filters_advanced.py +540 -0
  22. imagen_cli-0.1.1/src/imagen_cli/application/filters_fast.py +66 -0
  23. imagen_cli-0.1.1/src/imagen_cli/application/filters_frequency.py +92 -0
  24. imagen_cli-0.1.1/src/imagen_cli/application/filters_numpy.py +467 -0
  25. imagen_cli-0.1.1/src/imagen_cli/application/filters_rank.py +50 -0
  26. imagen_cli-0.1.1/src/imagen_cli/application/filters_restoration.py +327 -0
  27. imagen_cli-0.1.1/src/imagen_cli/application/filters_structure.py +223 -0
  28. imagen_cli-0.1.1/src/imagen_cli/application/fork_service.py +52 -0
  29. imagen_cli-0.1.1/src/imagen_cli/application/import_service.py +608 -0
  30. imagen_cli-0.1.1/src/imagen_cli/application/job_state.py +41 -0
  31. imagen_cli-0.1.1/src/imagen_cli/application/media_ops.py +2163 -0
  32. imagen_cli-0.1.1/src/imagen_cli/application/model_catalog_service.py +153 -0
  33. imagen_cli-0.1.1/src/imagen_cli/application/opener.py +25 -0
  34. imagen_cli-0.1.1/src/imagen_cli/application/operator_catalog.py +2997 -0
  35. imagen_cli-0.1.1/src/imagen_cli/application/operator_catalog_en.py +1859 -0
  36. imagen_cli-0.1.1/src/imagen_cli/application/outcome_service.py +160 -0
  37. imagen_cli-0.1.1/src/imagen_cli/application/planning_service.py +268 -0
  38. imagen_cli-0.1.1/src/imagen_cli/application/postprocess_service.py +479 -0
  39. imagen_cli-0.1.1/src/imagen_cli/application/postprocess_worker.py +92 -0
  40. imagen_cli-0.1.1/src/imagen_cli/application/preflight.py +123 -0
  41. imagen_cli-0.1.1/src/imagen_cli/application/profile_service.py +53 -0
  42. imagen_cli-0.1.1/src/imagen_cli/application/quality_service.py +49 -0
  43. imagen_cli-0.1.1/src/imagen_cli/application/reconcile.py +84 -0
  44. imagen_cli-0.1.1/src/imagen_cli/application/release_readiness.py +56 -0
  45. imagen_cli-0.1.1/src/imagen_cli/application/session_service.py +253 -0
  46. imagen_cli-0.1.1/src/imagen_cli/application/sheet_service.py +97 -0
  47. imagen_cli-0.1.1/src/imagen_cli/application/skill_targets.NOTICE.md +33 -0
  48. imagen_cli-0.1.1/src/imagen_cli/application/skill_targets.json +397 -0
  49. imagen_cli-0.1.1/src/imagen_cli/application/skill_targets.py +42 -0
  50. imagen_cli-0.1.1/src/imagen_cli/application/skills_service.py +416 -0
  51. imagen_cli-0.1.1/src/imagen_cli/application/superres.py +500 -0
  52. imagen_cli-0.1.1/src/imagen_cli/application/update_service.py +123 -0
  53. imagen_cli-0.1.1/src/imagen_cli/bundled_skills/imagen/SKILL.md +46 -0
  54. imagen_cli-0.1.1/src/imagen_cli/bundled_skills/imagen/references/workflows.md +66 -0
  55. imagen_cli-0.1.1/src/imagen_cli/bundled_skills/imagen-assets/SKILL.md +64 -0
  56. imagen_cli-0.1.1/src/imagen_cli/bundled_skills/imagen-batch/SKILL.md +61 -0
  57. imagen_cli-0.1.1/src/imagen_cli/cli/commands/asset.py +58 -0
  58. imagen_cli-0.1.1/src/imagen_cli/cli/commands/batch.py +25 -0
  59. imagen_cli-0.1.1/src/imagen_cli/cli/commands/cache.py +59 -0
  60. imagen_cli-0.1.1/src/imagen_cli/cli/commands/create.py +179 -0
  61. imagen_cli-0.1.1/src/imagen_cli/cli/commands/discovery.py +51 -0
  62. imagen_cli-0.1.1/src/imagen_cli/cli/commands/history.py +156 -0
  63. imagen_cli-0.1.1/src/imagen_cli/cli/commands/job.py +165 -0
  64. imagen_cli-0.1.1/src/imagen_cli/cli/commands/models.py +69 -0
  65. imagen_cli-0.1.1/src/imagen_cli/cli/commands/plan.py +22 -0
  66. imagen_cli-0.1.1/src/imagen_cli/cli/commands/postprocess.py +125 -0
  67. imagen_cli-0.1.1/src/imagen_cli/cli/commands/profile.py +141 -0
  68. imagen_cli-0.1.1/src/imagen_cli/cli/commands/session.py +79 -0
  69. imagen_cli-0.1.1/src/imagen_cli/cli/commands/skills.py +42 -0
  70. imagen_cli-0.1.1/src/imagen_cli/cli/commands/worker.py +33 -0
  71. imagen_cli-0.1.1/src/imagen_cli/cli/creation_input.py +35 -0
  72. imagen_cli-0.1.1/src/imagen_cli/cli/diagnostics.py +62 -0
  73. imagen_cli-0.1.1/src/imagen_cli/cli/entrypoint.py +705 -0
  74. imagen_cli-0.1.1/src/imagen_cli/cli/generated_docs.py +337 -0
  75. imagen_cli-0.1.1/src/imagen_cli/cli/human.py +715 -0
  76. imagen_cli-0.1.1/src/imagen_cli/cli/input_readers.py +152 -0
  77. imagen_cli-0.1.1/src/imagen_cli/cli/options.py +75 -0
  78. imagen_cli-0.1.1/src/imagen_cli/cli/preview.py +32 -0
  79. imagen_cli-0.1.1/src/imagen_cli/cli/registry.py +837 -0
  80. imagen_cli-0.1.1/src/imagen_cli/cli/renderers.py +191 -0
  81. imagen_cli-0.1.1/src/imagen_cli/cli/selection.py +27 -0
  82. imagen_cli-0.1.1/src/imagen_cli/cli/tui/__init__.py +0 -0
  83. imagen_cli-0.1.1/src/imagen_cli/cli/tui/app.py +2691 -0
  84. imagen_cli-0.1.1/src/imagen_cli/cli/tui/preview.py +54 -0
  85. imagen_cli-0.1.1/src/imagen_cli/cli/usage.py +177 -0
  86. imagen_cli-0.1.1/src/imagen_cli/domain/__init__.py +1 -0
  87. imagen_cli-0.1.1/src/imagen_cli/domain/contracts.py +123 -0
  88. imagen_cli-0.1.1/src/imagen_cli/domain/enums.py +143 -0
  89. imagen_cli-0.1.1/src/imagen_cli/domain/errors.py +32 -0
  90. imagen_cli-0.1.1/src/imagen_cli/domain/models.py +392 -0
  91. imagen_cli-0.1.1/src/imagen_cli/domain/primitive.py +80 -0
  92. imagen_cli-0.1.1/src/imagen_cli/execution/configured.py +72 -0
  93. imagen_cli-0.1.1/src/imagen_cli/execution/foreground.py +106 -0
  94. imagen_cli-0.1.1/src/imagen_cli/execution/queued.py +110 -0
  95. imagen_cli-0.1.1/src/imagen_cli/execution/recovery.py +67 -0
  96. imagen_cli-0.1.1/src/imagen_cli/execution/worker.py +448 -0
  97. imagen_cli-0.1.1/src/imagen_cli/i18n.py +145 -0
  98. imagen_cli-0.1.1/src/imagen_cli/providers/automatic1111.py +172 -0
  99. imagen_cli-0.1.1/src/imagen_cli/providers/base.py +146 -0
  100. imagen_cli-0.1.1/src/imagen_cli/providers/bfl.py +240 -0
  101. imagen_cli-0.1.1/src/imagen_cli/providers/comfyui.py +228 -0
  102. imagen_cli-0.1.1/src/imagen_cli/providers/common.py +173 -0
  103. imagen_cli-0.1.1/src/imagen_cli/providers/contracts.py +34 -0
  104. imagen_cli-0.1.1/src/imagen_cli/providers/gemini.py +263 -0
  105. imagen_cli-0.1.1/src/imagen_cli/providers/google_cloud.py +303 -0
  106. imagen_cli-0.1.1/src/imagen_cli/providers/model_platforms.py +574 -0
  107. imagen_cli-0.1.1/src/imagen_cli/providers/openai_compatible.py +160 -0
  108. imagen_cli-0.1.1/src/imagen_cli/providers/openai_images.py +236 -0
  109. imagen_cli-0.1.1/src/imagen_cli/providers/openai_responses.py +155 -0
  110. imagen_cli-0.1.1/src/imagen_cli/providers/openrouter.py +142 -0
  111. imagen_cli-0.1.1/src/imagen_cli/providers/stability.py +193 -0
  112. imagen_cli-0.1.1/src/imagen_cli/storage/artifacts.py +164 -0
  113. imagen_cli-0.1.1/src/imagen_cli/storage/config.py +23 -0
  114. imagen_cli-0.1.1/src/imagen_cli/storage/database.py +48 -0
  115. imagen_cli-0.1.1/src/imagen_cli/storage/download.py +165 -0
  116. imagen_cli-0.1.1/src/imagen_cli/storage/migrations.py +138 -0
  117. imagen_cli-0.1.1/src/imagen_cli/storage/private_state.py +193 -0
  118. imagen_cli-0.1.1/src/imagen_cli/storage/queries.py +70 -0
  119. imagen_cli-0.1.1/src/imagen_cli/storage/repositories.py +410 -0
  120. imagen_cli-0.1.1/src/imagen_cli/storage/safety.py +451 -0
  121. imagen_cli-0.1.1/src/imagen_cli/storage/workspace.py +26 -0
  122. imagen_cli-0.1.1/tests/__init__.py +0 -0
  123. imagen_cli-0.1.1/tests/conftest.py +20 -0
  124. imagen_cli-0.1.1/tests/contract/test_asset_commands.py +163 -0
  125. imagen_cli-0.1.1/tests/contract/test_bundled_skill_guides.py +21 -0
  126. imagen_cli-0.1.1/tests/contract/test_cli_output_modes.py +41 -0
  127. imagen_cli-0.1.1/tests/contract/test_cost_usage.py +115 -0
  128. imagen_cli-0.1.1/tests/contract/test_creation_input.py +67 -0
  129. imagen_cli-0.1.1/tests/contract/test_creation_planning_cli.py +164 -0
  130. imagen_cli-0.1.1/tests/contract/test_discovery_commands.py +69 -0
  131. imagen_cli-0.1.1/tests/contract/test_gemini_contract.py +271 -0
  132. imagen_cli-0.1.1/tests/contract/test_generated_docs.py +52 -0
  133. imagen_cli-0.1.1/tests/contract/test_job_cancel.py +180 -0
  134. imagen_cli-0.1.1/tests/contract/test_local_discovery.py +45 -0
  135. imagen_cli-0.1.1/tests/contract/test_machine_contracts.py +198 -0
  136. imagen_cli-0.1.1/tests/contract/test_openai_images_contract.py +468 -0
  137. imagen_cli-0.1.1/tests/contract/test_openai_responses.py +122 -0
  138. imagen_cli-0.1.1/tests/contract/test_plan_commands.py +189 -0
  139. imagen_cli-0.1.1/tests/contract/test_profile_commands.py +77 -0
  140. imagen_cli-0.1.1/tests/contract/test_provider_adapters.py +509 -0
  141. imagen_cli-0.1.1/tests/contract/test_provider_contracts.py +28 -0
  142. imagen_cli-0.1.1/tests/contract/test_registry_composition_foundation.py +158 -0
  143. imagen_cli-0.1.1/tests/contract/test_requirements_traceability.py +51 -0
  144. imagen_cli-0.1.1/tests/contract/test_secret_redaction.py +55 -0
  145. imagen_cli-0.1.1/tests/contract/test_t037_create_handlers.py +129 -0
  146. imagen_cli-0.1.1/tests/contract/test_t039_local_job_handlers.py +147 -0
  147. imagen_cli-0.1.1/tests/contract/test_t039_local_session_handlers.py +58 -0
  148. imagen_cli-0.1.1/tests/fault/test_cancel_races.py +73 -0
  149. imagen_cli-0.1.1/tests/fault/test_create_recovery.py +89 -0
  150. imagen_cli-0.1.1/tests/fault/test_download_security.py +192 -0
  151. imagen_cli-0.1.1/tests/fault/test_file_recovery.py +103 -0
  152. imagen_cli-0.1.1/tests/fault/test_no_duplicate_create.py +83 -0
  153. imagen_cli-0.1.1/tests/fault/test_portable_archive.py +318 -0
  154. imagen_cli-0.1.1/tests/fixtures/__init__.py +0 -0
  155. imagen_cli-0.1.1/tests/fixtures/contracts/creation-input.schema.json +32 -0
  156. imagen_cli-0.1.1/tests/fixtures/contracts/event.schema.json +21 -0
  157. imagen_cli-0.1.1/tests/fixtures/contracts/examples.json +24 -0
  158. imagen_cli-0.1.1/tests/fixtures/contracts/result.schema.json +41 -0
  159. imagen_cli-0.1.1/tests/fixtures/offline.py +44 -0
  160. imagen_cli-0.1.1/tests/integration/test_approval_execution.py +56 -0
  161. imagen_cli-0.1.1/tests/integration/test_approved_execution.py +317 -0
  162. imagen_cli-0.1.1/tests/integration/test_async_consumer.py +134 -0
  163. imagen_cli-0.1.1/tests/integration/test_async_worker.py +101 -0
  164. imagen_cli-0.1.1/tests/integration/test_batch_execution.py +240 -0
  165. imagen_cli-0.1.1/tests/integration/test_cli_approved_journey.py +97 -0
  166. imagen_cli-0.1.1/tests/integration/test_configured_gemini.py +61 -0
  167. imagen_cli-0.1.1/tests/integration/test_configured_timeout.py +67 -0
  168. imagen_cli-0.1.1/tests/integration/test_cross_provider_approval.py +175 -0
  169. imagen_cli-0.1.1/tests/integration/test_experimental_postprocess_cli.py +87 -0
  170. imagen_cli-0.1.1/tests/integration/test_i18n_cli.py +118 -0
  171. imagen_cli-0.1.1/tests/integration/test_local_cli.py +268 -0
  172. imagen_cli-0.1.1/tests/integration/test_m1_safety_gate.py +143 -0
  173. imagen_cli-0.1.1/tests/integration/test_response_recovery.py +180 -0
  174. imagen_cli-0.1.1/tests/integration/test_session_concurrency.py +88 -0
  175. imagen_cli-0.1.1/tests/integration/test_session_history.py +320 -0
  176. imagen_cli-0.1.1/tests/integration/test_session_resume_edit.py +257 -0
  177. imagen_cli-0.1.1/tests/integration/test_setup_selection.py +32 -0
  178. imagen_cli-0.1.1/tests/integration/test_skills_install.py +191 -0
  179. imagen_cli-0.1.1/tests/integration/test_skills_safety.py +79 -0
  180. imagen_cli-0.1.1/tests/integration/test_skills_targets_cli.py +32 -0
  181. imagen_cli-0.1.1/tests/integration/test_skills_update.py +96 -0
  182. imagen_cli-0.1.1/tests/integration/test_worker_lifecycle.py +293 -0
  183. imagen_cli-0.1.1/tests/live/conftest.py +20 -0
  184. imagen_cli-0.1.1/tests/live/journey.py +348 -0
  185. imagen_cli-0.1.1/tests/live/test_authorized_providers.py +115 -0
  186. imagen_cli-0.1.1/tests/live/test_provider_journey.py +33 -0
  187. imagen_cli-0.1.1/tests/smoke/test_cross_platform.py +53 -0
  188. imagen_cli-0.1.1/tests/smoke/test_human_terminal.py +103 -0
  189. imagen_cli-0.1.1/tests/smoke/test_offline_contract.py +88 -0
  190. imagen_cli-0.1.1/tests/smoke/test_performance.py +50 -0
  191. imagen_cli-0.1.1/tests/smoke/test_preview.py +52 -0
  192. imagen_cli-0.1.1/tests/smoke/test_release_readiness.py +50 -0
  193. imagen_cli-0.1.1/tests/smoke/test_tui.py +1224 -0
  194. imagen_cli-0.1.1/tests/smoke/test_tui_i18n.py +35 -0
  195. imagen_cli-0.1.1/tests/storage/test_migrations_v2.py +42 -0
  196. imagen_cli-0.1.1/tests/support.py +36 -0
  197. imagen_cli-0.1.1/tests/unit/test_advanced_ops.py +192 -0
  198. imagen_cli-0.1.1/tests/unit/test_artifact_outcome_service.py +274 -0
  199. imagen_cli-0.1.1/tests/unit/test_batch_summary.py +129 -0
  200. imagen_cli-0.1.1/tests/unit/test_cache_service.py +229 -0
  201. imagen_cli-0.1.1/tests/unit/test_cli_selection.py +10 -0
  202. imagen_cli-0.1.1/tests/unit/test_cli_sync_gaps.py +65 -0
  203. imagen_cli-0.1.1/tests/unit/test_cli_usage_errors.py +98 -0
  204. imagen_cli-0.1.1/tests/unit/test_cli_version_and_session_view.py +80 -0
  205. imagen_cli-0.1.1/tests/unit/test_credentials.py +99 -0
  206. imagen_cli-0.1.1/tests/unit/test_domain_validation.py +453 -0
  207. imagen_cli-0.1.1/tests/unit/test_fast_guided.py +74 -0
  208. imagen_cli-0.1.1/tests/unit/test_filters_advanced.py +267 -0
  209. imagen_cli-0.1.1/tests/unit/test_filters_numpy.py +68 -0
  210. imagen_cli-0.1.1/tests/unit/test_filters_restoration.py +182 -0
  211. imagen_cli-0.1.1/tests/unit/test_filters_structure.py +58 -0
  212. imagen_cli-0.1.1/tests/unit/test_foreground.py +295 -0
  213. imagen_cli-0.1.1/tests/unit/test_frequency_detection.py +84 -0
  214. imagen_cli-0.1.1/tests/unit/test_gc_staging.py +27 -0
  215. imagen_cli-0.1.1/tests/unit/test_i18n.py +106 -0
  216. imagen_cli-0.1.1/tests/unit/test_job_state.py +44 -0
  217. imagen_cli-0.1.1/tests/unit/test_journey_dossier.py +74 -0
  218. imagen_cli-0.1.1/tests/unit/test_kuwahara_identity.py +38 -0
  219. imagen_cli-0.1.1/tests/unit/test_local_laplacian.py +58 -0
  220. imagen_cli-0.1.1/tests/unit/test_media_ops.py +331 -0
  221. imagen_cli-0.1.1/tests/unit/test_offline_fixtures.py +26 -0
  222. imagen_cli-0.1.1/tests/unit/test_operator_catalog_plain_language.py +52 -0
  223. imagen_cli-0.1.1/tests/unit/test_operator_catalog_upgrade.py +196 -0
  224. imagen_cli-0.1.1/tests/unit/test_planning_service.py +277 -0
  225. imagen_cli-0.1.1/tests/unit/test_postprocess.py +202 -0
  226. imagen_cli-0.1.1/tests/unit/test_postprocess_budget.py +94 -0
  227. imagen_cli-0.1.1/tests/unit/test_postprocess_catalog_display.py +134 -0
  228. imagen_cli-0.1.1/tests/unit/test_postprocess_color.py +51 -0
  229. imagen_cli-0.1.1/tests/unit/test_postprocess_eval.py +135 -0
  230. imagen_cli-0.1.1/tests/unit/test_postprocess_op_parser.py +37 -0
  231. imagen_cli-0.1.1/tests/unit/test_postprocess_provenance.py +41 -0
  232. imagen_cli-0.1.1/tests/unit/test_postprocess_registry.py +31 -0
  233. imagen_cli-0.1.1/tests/unit/test_postprocess_replay.py +50 -0
  234. imagen_cli-0.1.1/tests/unit/test_postprocess_replay_pipeline.py +33 -0
  235. imagen_cli-0.1.1/tests/unit/test_postprocess_versions.py +30 -0
  236. imagen_cli-0.1.1/tests/unit/test_postprocess_worker.py +57 -0
  237. imagen_cli-0.1.1/tests/unit/test_private_permissions.py +138 -0
  238. imagen_cli-0.1.1/tests/unit/test_process_identity.py +45 -0
  239. imagen_cli-0.1.1/tests/unit/test_profile_service.py +47 -0
  240. imagen_cli-0.1.1/tests/unit/test_profile_set_and_catalog.py +155 -0
  241. imagen_cli-0.1.1/tests/unit/test_provider_base.py +111 -0
  242. imagen_cli-0.1.1/tests/unit/test_quality_service.py +62 -0
  243. imagen_cli-0.1.1/tests/unit/test_repository_invariants.py +240 -0
  244. imagen_cli-0.1.1/tests/unit/test_session_remove_artifact.py +186 -0
  245. imagen_cli-0.1.1/tests/unit/test_sheet_service.py +73 -0
  246. imagen_cli-0.1.1/tests/unit/test_skill_targets.py +30 -0
  247. imagen_cli-0.1.1/tests/unit/test_ssim_local.py +47 -0
  248. imagen_cli-0.1.1/tests/unit/test_storage.py +298 -0
  249. imagen_cli-0.1.1/tests/unit/test_superres.py +385 -0
  250. imagen_cli-0.1.1/tests/unit/test_transform_preset_cli.py +152 -0
  251. imagen_cli-0.1.1/tests/unit/test_tui_controls.py +45 -0
  252. imagen_cli-0.1.1/tests/unit/test_tui_palette_arguments.py +15 -0
  253. imagen_cli-0.1.1/tests/unit/test_tui_shared_presets.py +55 -0
  254. imagen_cli-0.1.1/tests/unit/test_update_check.py +146 -0
  255. imagen_cli-0.1.1/tests/unit/test_weighted_guided.py +65 -0
  256. imagen_cli-0.1.1/tests/unit/test_weighted_median.py +50 -0
  257. imagen_cli-0.1.1/tests/unit/test_wls_detail.py +48 -0
@@ -0,0 +1,30 @@
1
+ __pycache__/
2
+ *.py[cod]
3
+ .venv/
4
+ venv/
5
+ dist/
6
+ build/
7
+ *.egg-info/
8
+ .pytest_cache/
9
+ .ruff_cache/
10
+ .mypy_cache/
11
+ .coverage
12
+ htmlcov/
13
+ .env
14
+ .env.*
15
+ *.log
16
+ *.tmp
17
+ *.swp
18
+ .DS_Store
19
+ Thumbs.db
20
+ .vscode/
21
+ .idea/
22
+ live-results/
23
+ .claude/
24
+ .agents/
25
+ .specify/
26
+ .codegraph/
27
+
28
+ # Local-only design and spec documents
29
+ docs/
30
+ specs/
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Ext Chulise
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,586 @@
1
+ Metadata-Version: 2.5
2
+ Name: imagen-cli
3
+ Version: 0.1.1
4
+ Summary: Persistent image creation workbench for humans and agents
5
+ Project-URL: Homepage, https://github.com/NekoCCN/ImagenCli
6
+ Project-URL: Source, https://github.com/NekoCCN/ImagenCli
7
+ Project-URL: Releases, https://github.com/NekoCCN/ImagenCli/releases
8
+ License-Expression: MIT
9
+ License-File: LICENSE
10
+ Requires-Python: >=3.12
11
+ Requires-Dist: httpx>=0.28
12
+ Requires-Dist: jsonschema>=4.23
13
+ Requires-Dist: pillow>=11
14
+ Requires-Dist: platformdirs>=4
15
+ Requires-Dist: pydantic<3,>=2.10
16
+ Requires-Dist: rich>=13
17
+ Requires-Dist: typer>=0.15
18
+ Provides-Extra: ai-onnx
19
+ Requires-Dist: numpy>=2; extra == 'ai-onnx'
20
+ Requires-Dist: onnx>=1.20; extra == 'ai-onnx'
21
+ Requires-Dist: onnxruntime>=1.20; extra == 'ai-onnx'
22
+ Provides-Extra: ai-onnx-gpu
23
+ Requires-Dist: numpy>=2; extra == 'ai-onnx-gpu'
24
+ Requires-Dist: onnx>=1.20; extra == 'ai-onnx-gpu'
25
+ Requires-Dist: onnxruntime-gpu>=1.20; extra == 'ai-onnx-gpu'
26
+ Provides-Extra: ai-openvino
27
+ Requires-Dist: numpy>=2; extra == 'ai-openvino'
28
+ Requires-Dist: onnx>=1.20; extra == 'ai-openvino'
29
+ Requires-Dist: onnxruntime-openvino>=1.20; extra == 'ai-openvino'
30
+ Provides-Extra: ai-torch
31
+ Requires-Dist: numpy>=2; extra == 'ai-torch'
32
+ Requires-Dist: torch>=2.4; extra == 'ai-torch'
33
+ Provides-Extra: keyring
34
+ Requires-Dist: keyring>=25; extra == 'keyring'
35
+ Provides-Extra: postprocess
36
+ Requires-Dist: numpy>=2; extra == 'postprocess'
37
+ Provides-Extra: tui
38
+ Requires-Dist: textual>=0.80; extra == 'tui'
39
+ Provides-Extra: vertex
40
+ Requires-Dist: google-auth>=2; extra == 'vertex'
41
+ Description-Content-Type: text/markdown
42
+
43
+ <p align="center">
44
+ <img src="assets/imagen-title-catgirl.png" alt="Imagen project icon" width="960">
45
+ </p>
46
+
47
+ <p align="center">
48
+ <strong>A bridge between people, agents, and image generation models.</strong><br>
49
+ <a href="README.zh-CN.md">中文</a>
50
+ </p>
51
+
52
+ Imagen connects people and coding agents to image generation models through a shared workspace. People can browse images, adjust parameters, review requests, and manage artifacts in the TUI. Agents can use the CLI, JSON output, and bundled skills to do the same work in the same sessions.
53
+
54
+ Configure your own image endpoint, create a session, and keep working from either interface. Plans, execution records, jobs, and image artifacts are stored locally, so a request made by an agent can be inspected and continued by a person, and the other way around.
55
+
56
+ ## What it provides
57
+
58
+ - **One workspace, two interfaces.** The TUI and CLI read and write the same sessions, plans, jobs, and artifacts.
59
+ - **Your endpoint, your models.** Profiles support OpenAI-compatible Images endpoints and other adapters. Available models and parameters come from the configured endpoint.
60
+ - **Explicit execution.** A plan freezes the request for review. Approval and execution are separate steps; creating a plan never sends a generation request.
61
+ - **Local postprocessing.** Smoothing, line work, tone and color changes, periodic-frequency suppression, resizing, comparison, and contact sheets.
62
+ - **Batch and background work.** Local queues, independent child jobs, and an async worker.
63
+ - **Agent skills.** Bundled guides teach coding agents the CLI, approval rules, artifact handling, and cost and weight boundaries. They install into project or global directories for supported agents.
64
+ - **Optional local upscaling.** Model weights are selected and downloaded by the user, then checked against a pinned SHA-256 digest.
65
+ - **English and Chinese interface text.** English is the default; JSON keys, statuses, and command identifiers do not change with the language.
66
+
67
+ Processing always creates a new artifact. It never overwrites the input.
68
+
69
+ ## How it fits together
70
+
71
+ ```text
72
+ request ──► plan (review) ──► approve ──► execute ──► job + artifact
73
+ │
74
+ postprocess ◄─┴─► compare / sheet
75
+ ```
76
+
77
+ A turn records one creation attempt. A plan records the frozen request and digest. An artifact records the image and its provenance. Sessions group turns and artifacts. None of these require the TUI: the CLI produces the same records, and the TUI renders them.
78
+
79
+ ## TUI and CLI at a glance
80
+
81
+ Most daily work is available in both interfaces. Keys below are TUI shortcuts.
82
+
83
+ | Task | TUI | CLI |
84
+ | --- | --- | --- |
85
+ | Browse sessions and images | session list, preview pane, `[` / `]` | `session list`, `session show`, `asset show` |
86
+ | Generate an image | `g` | `generate --input-json request.json` |
87
+ | Edit an image | `m` | `edit --input-json request.json` |
88
+ | Approve, execute, retry a plan | plan screen: `a`, `enter`, `r` | `plan approve`, `plan execute`, `plan retry` |
89
+ | Inspect jobs | not available | `job get`, `job wait`, `job fetch`, `job reconcile` |
90
+ | Local postprocessing | `t`, then `p` for parameters | `ops`, `transform`, `compare`, `sheet` |
91
+ | Open an image or folder | `o` / `O` | `asset open [--folder]` |
92
+ | Fork, export, delete a session | `f`, `e`, `x` | `session fork`, `session export`, `session delete` |
93
+ | Delete an image | `d` | `session remove-artifact`, `asset delete` |
94
+ | Providers and models | `v` | `profile ...`, `models ...`, `providers` |
95
+ | Cache audit and purge | `c` | `cache audit`, `cache purge` |
96
+ | Batch requests | not available | `batch submit`, `batch get`, `batch wait` |
97
+ | Background worker | not available | `worker start`, `worker status`, `worker recover` |
98
+ | Agent skills | not available | `skills list`, `skills install`, `skills uninstall` |
99
+ | Upscaling models | not available | `superres models`, `superres fetch`, `superres benchmark` |
100
+ | Command reference | `:` palette, `?` help | `imagen help`, `imagen schema` |
101
+ | Switch interface language | `l` (remembered) | `--zh` / `--en`, `language` |
102
+
103
+ ## Screenshots
104
+
105
+ ### TUI
106
+
107
+ <p align="center"><img src="assets/imagen-tui.png" alt="Imagen TUI workspace" width="960"></p>
108
+
109
+ A saved session with image preview and artifact selection.
110
+
111
+ ### CLI
112
+
113
+ <p align="center"><img src="assets/imagen-cli.png" alt="Imagen CLI command help" width="960"></p>
114
+
115
+ Command help for `generate`.
116
+
117
+ ## Install
118
+
119
+ Imagen requires Python 3.12 or later.
120
+
121
+ ### Standard install (uv)
122
+
123
+ ```bash
124
+ uv tool install "imagen-cli[tui,postprocess]"
125
+ imagen --version
126
+ ```
127
+
128
+ This is the supported install: `uv tool` puts `imagen` on your `PATH` and owns
129
+ the copy, so Imagen can update itself. Drop `[tui,postprocess]` if you only
130
+ need the CLI.
131
+
132
+ ```bash
133
+ imagen update # is a newer release out?
134
+ imagen update --install # install it with the installer that owns this copy
135
+ ```
136
+
137
+ ### Standard install (pipx)
138
+
139
+ ```bash
140
+ pipx install "imagen-cli[tui,postprocess]"
141
+ ```
142
+
143
+ `imagen update --install` detects pipx and runs `pipx upgrade imagen-cli`.
144
+
145
+ ### From a checkout (development)
146
+
147
+ ```bash
148
+ uv sync --extra tui --extra postprocess
149
+ uv run imagen tui
150
+ ```
151
+
152
+ Install into an existing virtual environment instead:
153
+
154
+ ```bash
155
+ python -m pip install '.[tui,postprocess]'
156
+ imagen tui
157
+ ```
158
+
159
+ A checkout or a plain `pip install` has no standard owner: `imagen update`
160
+ still reports the newest release, but `--install` refuses and prints the
161
+ command to run instead of guessing.
162
+
163
+ `tui` installs Textual. `postprocess` installs the local image-processing dependencies. The base CLI, profiles, sessions, and provider access work without either extra.
164
+
165
+ Useful entry points:
166
+
167
+ ```bash
168
+ imagen help # command index
169
+ imagen help generate # parameters for one command
170
+ imagen schema generate # JSON Schema, no network
171
+ imagen --agent help # machine-oriented reference
172
+ ```
173
+
174
+ ## Quick start
175
+
176
+ 1. Configure an endpoint and a credential reference.
177
+ 2. Create a session.
178
+ 3. Generate a plan, review it, approve it, execute it.
179
+ 4. Inspect the job and artifact.
180
+ 5. Optionally postprocess the artifact or compare it with another one.
181
+
182
+ ```bash
183
+ export IMAGEN_API_KEY='your-api-key'
184
+
185
+ imagen profile set local \
186
+ --provider openai \
187
+ --family images \
188
+ --base-url http://127.0.0.1:8000/v1 \
189
+ --model-default your-image-model \
190
+ --credential-ref env:IMAGEN_API_KEY
191
+
192
+ imagen models refresh --profile local
193
+ imagen session create sketchbook --output json
194
+ ```
195
+
196
+ Then write `request.json` with the returned session ID:
197
+
198
+ ```json
199
+ {
200
+ "schema_version": 1,
201
+ "operation": "generate",
202
+ "session": "ses_REPLACE_WITH_RETURNED_ID",
203
+ "profile": "local",
204
+ "prompt": "A concise cel-shaded illustration with a solid background",
205
+ "count": 1
206
+ }
207
+ ```
208
+
209
+ ```bash
210
+ imagen generate --input-json request.json --output json
211
+ imagen plan approve PLAN_ID --digest PLAN_DIGEST
212
+ imagen plan execute PLAN_ID
213
+ ```
214
+
215
+ The same flow is available in the TUI: press `g`, fill the form, approve the plan with `a`, then execute with `enter`.
216
+
217
+ ## Configure endpoints
218
+
219
+ Profiles keep an endpoint, model defaults, and a credential reference. The endpoint decides which models, operations, and parameters actually work.
220
+
221
+ ```bash
222
+ imagen profile set local \
223
+ --provider openai \
224
+ --family images \
225
+ --base-url http://127.0.0.1:8000/v1 \
226
+ --model-default your-image-model \
227
+ --credential-ref env:IMAGEN_API_KEY
228
+
229
+ imagen profile list
230
+ imagen profile show local
231
+ imagen profile update local --model-default another-model
232
+ ```
233
+
234
+ Credential references:
235
+
236
+ - `env:NAME` reads an environment variable.
237
+ - `keyring:SERVICE` reads the operating-system keyring.
238
+ - `private:NAME` reads Imagen's private store in the workspace.
239
+
240
+ To import a key file into the private store without echoing it:
241
+
242
+ ```bash
243
+ imagen profile secret --profile local --key-file ./key.txt
244
+ ```
245
+
246
+ Do not put credentials in command arguments, request files, or session exports.
247
+
248
+ Models are declared per profile:
249
+
250
+ ```bash
251
+ imagen models refresh --profile local # fetch from the endpoint
252
+ imagen models add --profile local --id model-id
253
+ imagen models list --profile local
254
+ imagen models use local --id model-id # set the profile default
255
+ ```
256
+
257
+ In the TUI, press `v` to add or update profiles, refresh models, choose a default model, or enter a model ID manually.
258
+
259
+ ## Generate and edit
260
+
261
+ Both operations follow the same lifecycle. `generate` creates an image; `edit` takes existing artifacts as inputs and may take a mask.
262
+
263
+ ```bash
264
+ imagen generate --input-json request.json --output json
265
+ imagen edit --input-json edit-request.json --output json
266
+ ```
267
+
268
+ The result is a plan with an ID and a digest. A plan does not contact the provider.
269
+
270
+ ```bash
271
+ imagen plan show PLAN_ID
272
+ imagen plan approve PLAN_ID --digest PLAN_DIGEST
273
+ imagen plan execute PLAN_ID
274
+ ```
275
+
276
+ Rules that matter:
277
+
278
+ - One execution sends at most one creation request.
279
+ - An approval is consumed by execution and cannot be reused.
280
+ - An unknown outcome is not retried automatically. Inspect the job first.
281
+ - An unknown cost is not recorded as zero.
282
+ - `plan execute` may incur a provider charge.
283
+ - A failed request can be retried with `plan retry`, which creates a new plan; it does not reuse the old approval.
284
+
285
+ Async execution uses the local worker:
286
+
287
+ ```bash
288
+ imagen generate --input-json request.json --async
289
+ imagen worker start
290
+ imagen worker status
291
+ imagen worker recover
292
+ ```
293
+
294
+ `--wait` waits for completion instead of returning as soon as the job is queued.
295
+
296
+ In the TUI, `g` generates and `m` edits. The plan screen supports approve (`a`), execute (`enter`), and retry (`r`). Approval and execution stay separate keys.
297
+
298
+ ## Sessions, turns, and artifacts
299
+
300
+ A session groups turns and artifacts. A turn is one attempt. An artifact is a saved image with provenance.
301
+
302
+ ```bash
303
+ imagen session create sketchbook --output json
304
+ imagen session list
305
+ imagen session show ses_...
306
+ imagen session resume ses_...
307
+ imagen session fork ses_... --from-turn trn_... --name variant
308
+ imagen session export ses_... --to backup.zip
309
+ imagen session import backup.zip
310
+ imagen session delete ses_... --yes
311
+ imagen session remove-artifact ses_... art_...
312
+ ```
313
+
314
+ Artifacts can be inspected, opened, or deleted:
315
+
316
+ ```bash
317
+ imagen asset show art_...
318
+ imagen asset open art_...
319
+ imagen asset open art_... --folder
320
+ imagen asset delete art_...
321
+ imagen session remove-artifact ses_... art_...
322
+ ```
323
+
324
+ Orphaned managed files can be reclaimed:
325
+
326
+ ```bash
327
+ imagen asset gc # dry-run, lists unreferenced artifacts
328
+ imagen asset gc --plan DIGEST --yes
329
+ imagen cache audit
330
+ imagen cache purge --plan DIGEST --yes
331
+ ```
332
+
333
+ `asset delete` removes the artifact entity and its local file. `session remove-artifact` detaches the image from a session and, by default, reclaims the file when no other session references it. Soft-deleting a session frees its name for reuse; exports and imports remap identities, and exports do not include private credentials.
334
+
335
+ TUI equivalents: `n` creates a session, `f` forks the current turn, `e` exports, `x` deletes with typed confirmation, `d` removes the current image, `o` / `O` open the image or folder, and `c` audits and purges cache entries.
336
+
337
+ ## Jobs
338
+
339
+ ```bash
340
+ imagen job get job_...
341
+ imagen job wait job_... --timeout 600
342
+ imagen job fetch job_...
343
+ imagen job reconcile job_...
344
+ imagen job cancel job_...
345
+ ```
346
+
347
+ - `job get` reads persisted facts.
348
+ - `job wait` observes local state within a bound; it does not poll the provider.
349
+ - `job fetch` saves inline images or safely downloads a result from a persisted response. It never regenerates.
350
+ - `job reconcile` checks local staging and restores images.
351
+ - `job cancel` stops local observation and requests termination for locally owned work where supported.
352
+
353
+ ## Batch requests
354
+
355
+ `batch submit` validates every child request offline, approves and executes the batch, and creates one job per child.
356
+
357
+ ```bash
358
+ imagen batch submit --input-json requests.json --concurrency 2
359
+ imagen batch get bat_...
360
+ imagen batch wait bat_... --timeout 600
361
+ ```
362
+
363
+ `requests.json`:
364
+
365
+ ```json
366
+ {
367
+ "concurrency": 2,
368
+ "requests": [
369
+ {
370
+ "schema_version": 1,
371
+ "operation": "generate",
372
+ "session": "ses_...",
373
+ "profile": "local",
374
+ "prompt": "first prompt",
375
+ "size": "1024x1024"
376
+ },
377
+ {
378
+ "schema_version": 1,
379
+ "operation": "generate",
380
+ "session": "ses_...",
381
+ "profile": "local",
382
+ "prompt": "second prompt",
383
+ "size": "1024x1024"
384
+ }
385
+ ]
386
+ }
387
+ ```
388
+
389
+ Children succeed or fail independently. A partial failure does not re-run the whole batch; plan a new request only for the children that definitively failed. If a child's outcome is unknown, inspect that job before deciding.
390
+
391
+ Batch submission sends real requests. Obtain explicit authorization for the whole batch first.
392
+
393
+ ## Local postprocessing
394
+
395
+ Postprocessing is experimental. The CLI and TUI share one catalog, and every description states what the method does, what may change, and what may be lost.
396
+
397
+ <p align="center"><img src="assets/imagen-tui-transform.png" alt="Transform preset browser" width="960"></p>
398
+
399
+ <p align="center"><img src="assets/imagen-tui-params.png" alt="Parameter editor" width="560"></p>
400
+
401
+ Browse presets with a live preview, tune parameters, then apply. Results are saved as a new artifact.
402
+
403
+ ```bash
404
+ imagen ops # catalog
405
+ imagen ops --op guided_smooth # one operator
406
+ imagen ops --preset 'Anti-AI Organic' --verbose # recipe details
407
+ imagen transform ARTIFACT_ID --preset 'Pixel Art'
408
+ imagen transform ARTIFACT_ID --op 'guided_smooth:radius=4,epsilon=0.001,strength=0.5'
409
+ imagen compare art_a art_b
410
+ imagen sheet --artifacts art_a,art_b,art_c --columns 3
411
+ ```
412
+
413
+ The catalog covers smoothing, line extraction, tone and color adjustment, periodic-frequency suppression, resizing, contact sheets, and image comparison. Some operations follow guided filtering, weighted least squares, or Local Laplacian methods; variants and approximations are labeled.
414
+
415
+ Limits:
416
+
417
+ - Smoothing may remove fine lines.
418
+ - Sharpening may amplify noise.
419
+ - Frequency suppression may delete intentional halftone patterns.
420
+ - Difference metrics do not replace visual inspection.
421
+ - Operations have not completed image-quality and preference evaluation across illustration, photography, and other domains.
422
+
423
+ TUI: `t` opens the transform studio; `p` edits parameters; `enter` applies. Applying saves a new artifact and leaves the source untouched.
424
+
425
+ ## Optional upscaling
426
+
427
+ List local models and their licenses without downloading anything:
428
+
429
+ <img src="assets/imagen-cli-superres.png" alt="Upscaling models and licenses" width="760">
430
+
431
+ ```bash
432
+ imagen superres models
433
+ ```
434
+
435
+ After choosing a model and reviewing its source and weight license:
436
+
437
+ ```bash
438
+ imagen superres fetch --model realesrgan-x4plus --accept
439
+ imagen superres benchmark --artifact ARTIFACT_ID --model realesrgan-x4plus
440
+ ```
441
+
442
+ Downloaded weights are staged, checked against a pinned SHA-256 digest, and only then published into the weights directory. Failed or mismatched downloads leave no usable weight behind.
443
+
444
+ Imagen does not silently install the upscaling runtime or weights. A source-code license does not grant permission to use model weights. Reconstructed texture is not guaranteed to have existed in the original image.
445
+
446
+ ## Agent skills
447
+
448
+ Imagen ships skills that teach coding agents when to use it, how to discover commands and schemas, how to follow the plan and approval lifecycle, how to handle unknown outcomes, and how to respect cost, credential, and weight-download boundaries.
449
+
450
+ ```bash
451
+ imagen skills list
452
+ imagen skills install --target claude-code --target codex
453
+ imagen skills install --scope global --target claude-code
454
+ imagen skills uninstall --target codex
455
+ ```
456
+
457
+ <img src="assets/imagen-cli-skills.png" alt="Agent skill installation options" width="760">
458
+
459
+ - Default scope is the current project; `--scope global` installs into user directories.
460
+ - `--target` may be repeated. `--target all` selects every target in the bundled compatibility table.
461
+ - Project-only agents are reported when global installation is requested.
462
+ - Installation writes a managed manifest (`.imagen-install.json`). Uninstall refuses unmanaged directories and symlinked paths. A locally modified managed skill needs `--force --yes`.
463
+ - When run in a terminal without `--target`, Imagen shows an interactive target selector.
464
+
465
+ The bundled skills are `imagen`, `imagen-assets`, and `imagen-batch`.
466
+
467
+ ## Machine interface
468
+
469
+ `--agent` returns one JSON envelope; `--output json` does the same; `--output jsonl` emits events.
470
+
471
+ ```json
472
+ {
473
+ "schema_version": 1,
474
+ "ok": false,
475
+ "status": "approval_required",
476
+ "data": {},
477
+ "error": {
478
+ "type": "approval_required",
479
+ "message": "...",
480
+ "retryable": false,
481
+ "accepted_maybe": false,
482
+ "next_actions": []
483
+ }
484
+ }
485
+ ```
486
+
487
+ JSON keys, status names, and identifiers are identical in English and Chinese. Only human-readable message text follows the interface language.
488
+
489
+ Exit codes:
490
+
491
+ | Code | Meaning |
492
+ | --- | --- |
493
+ | 0 | succeeded, accepted, approved, or planned |
494
+ | 2 | validation error or unsupported capability |
495
+ | 3 | authentication or permission error |
496
+ | 4 | not found |
497
+ | 5 | conflict |
498
+ | 6 | wait timeout, unknown outcome, or approval required |
499
+ | 7 | failed, save failed, or canceled |
500
+ | 8 | safety refusal |
501
+ | 9 | partial success |
502
+
503
+ `imagen schema COMMAND` returns the input, data, and event schemas. `imagen help --agent` returns the command index and the calling rules.
504
+
505
+ ## Data and privacy
506
+
507
+ Sessions, plans, jobs, managed images, cache, and private credentials live in the workspace, by default under the user data directory. Use `--workspace PATH` to point commands at another workspace.
508
+
509
+ - Generation and editing send the prompt and required inputs to the endpoint you configured. Its retention, logging, and billing policies apply.
510
+ - Session exports exclude private credentials.
511
+ - Provider errors are reduced to safe categories; raw response bodies are never echoed into human output.
512
+ - Imagen does not retry unknown creation outcomes automatically.
513
+ - Imagen does not overwrite the source artifact during postprocessing.
514
+ - Imagen does not download model weights without explicit acceptance.
515
+
516
+ ## Language
517
+
518
+ English is the default for help, human output, errors, and the TUI.
519
+
520
+ ```bash
521
+ imagen --zh help # Chinese for one command
522
+ imagen --en help # force English
523
+ export IMAGEN_LANG=zh-CN # current shell only
524
+ imagen language zh-CN # save as the default
525
+ imagen language # show the saved default
526
+ imagen tui
527
+ ```
528
+
529
+ `--zh` and `--en` are shortcuts; `--lang en|zh-CN` is the explicit form. A language flag takes precedence over `IMAGEN_LANG`, and only one language selector may be used per command.
530
+
531
+ `imagen language [en|zh-CN]` writes the default to the platform config directory (`config.json` under the Imagen user config path, readable only by you). The TUI's `l` key saves the same preference, so the choice survives restarts. Precedence is: command-line flag, then `IMAGEN_LANG`, then the saved default, then English.
532
+
533
+ ## Troubleshooting
534
+
535
+ **`approval_required`.** Review the plan, then run `plan approve` with its digest, followed by `plan execute`.
536
+
537
+ **`unknown` outcome.** Do not rerun the request. Use `job get` and, when a response was persisted, `job fetch` or `job reconcile`.
538
+
539
+ **The model is missing.** Run `models refresh --profile NAME`, or declare it with `models add --profile NAME --id MODEL`.
540
+
541
+ **The endpoint rejects edit or a parameter.** Capability depends on the provider and model. Check `providers`, the model catalog, and the endpoint documentation.
542
+
543
+ **The TUI preview is unavailable.** Image preview needs a truecolor terminal. The artifact still opens with `o` or `imagen asset open`.
544
+
545
+ **A skill cannot be uninstalled.** The directory is unmanaged, symlinked, or was modified after installation. Inspect the reported path first. Locally modified managed skills need `--force --yes`; unmanaged directories are never taken over.
546
+
547
+ **Upscaling fails before inference.** The runtime or weights are missing. Run `superres models`, then `superres fetch --model NAME --accept` after reviewing the license.
548
+
549
+ ## Roadmap
550
+
551
+ - **Provider execution:** complete remote asynchronous job handling alongside the local queue and worker.
552
+ - **Image quality:** expand evaluation across illustration, photography, and other domains, including visual comparison and user preference. Postprocessing stays experimental until this is complete.
553
+ - **Platform support:** verify Windows on physical hardware and improve processing resource controls on Windows and macOS. Current size, buffer, and timeout checks are not a complete sandbox; Linux address-space limits do not cap RSS or GPU memory.
554
+ - **Language support:** add more interface languages. English is the default; Chinese is available through `--lang zh-CN` or `IMAGEN_LANG=zh-CN`.
555
+ - **Parity:** bring batch, worker, skills, and upscaling management into the TUI.
556
+
557
+ ## Development
558
+
559
+ ```bash
560
+ uv sync --group dev --extra tui --extra postprocess
561
+ uv run pytest
562
+ uv run ruff check .
563
+ uv run mypy src
564
+ ```
565
+
566
+ The default test suite is offline. Live provider tests are marked `live` and require explicit authorization and credentials; they are not part of normal development.
567
+
568
+ Source layout:
569
+
570
+ | Path | Responsibility |
571
+ | --- | --- |
572
+ | `src/imagen_cli/cli` | entrypoint, registry, renderers, TUI |
573
+ | `src/imagen_cli/application` | planning, execution, artifacts, sessions, postprocessing, skills |
574
+ | `src/imagen_cli/domain` | contracts, identifiers, errors |
575
+ | `src/imagen_cli/providers` | endpoint adapters |
576
+ | `src/imagen_cli/execution` | queues, workers, configured execution |
577
+ | `src/imagen_cli/storage` | SQLite, artifacts, private state, workspace safety |
578
+
579
+ ## Contributing
580
+
581
+ Small, focused changes are preferred. Add tests for behavior changes, keep provider requests behind the plan and approval boundary, and do not add live or paid provider tests without explicit authorization.
582
+
583
+ ## License
584
+
585
+ Imagen source code is available under the [MIT License](LICENSE). Third-party dependencies, provider services, and model weights are covered by their own terms.
586
+
@@ -0,0 +1,5 @@
1
+ # Imagen
2
+
3
+ The English README is maintained at [README.md](README.md).
4
+
5
+ 中文文档见 [README.zh-CN.md](README.zh-CN.md)。