kiapi 0.1.0__py3-none-any.whl
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.
- kiapi/__init__.py +3 -0
- kiapi/__main__.py +4 -0
- kiapi/api/__init__.py +26 -0
- kiapi/api/_constants/require_auth.py +14 -0
- kiapi/api/_helpers/build_job_responses.py +73 -0
- kiapi/api/_helpers/build_openapi.py +55 -0
- kiapi/api/_helpers/build_train_responses.py +21 -0
- kiapi/api/_helpers/get_accept.py +20 -0
- kiapi/api/_helpers/get_ctx.py +7 -0
- kiapi/api/_helpers/get_worker.py +7 -0
- kiapi/api/_helpers/register_capability_endpoints.py +70 -0
- kiapi/api/_helpers/submit_and_maybe_wait.py +113 -0
- kiapi/api/_settings.py +50 -0
- kiapi/api/_views/async_job_response.py +21 -0
- kiapi/api/_views/capability_model_spec.py +49 -0
- kiapi/api/app.py +150 -0
- kiapi/api/audio/acestep/_views/extract_response.py +57 -0
- kiapi/api/audio/acestep/_views/track_response.py +57 -0
- kiapi/api/audio/acestep/router.py +190 -0
- kiapi/api/audio/audiogen/_views/audio_response.py +46 -0
- kiapi/api/audio/audiogen/router.py +77 -0
- kiapi/api/chat/_views/chat_completion_response.py +71 -0
- kiapi/api/chat/router.py +253 -0
- kiapi/api/embedding/_views/embedding_response.py +35 -0
- kiapi/api/embedding/router.py +82 -0
- kiapi/api/files/_operations/get_file.py +14 -0
- kiapi/api/files/_operations/get_file_id.py +18 -0
- kiapi/api/files/_views/file_delete_response.py +14 -0
- kiapi/api/files/_views/file_list_response.py +15 -0
- kiapi/api/files/router.py +105 -0
- kiapi/api/health/_views/health_response.py +26 -0
- kiapi/api/health/router.py +28 -0
- kiapi/api/image/depthpro/_views/estimate_response.py +70 -0
- kiapi/api/image/depthpro/router.py +81 -0
- kiapi/api/image/ernie/_views/image_response.py +50 -0
- kiapi/api/image/ernie/router.py +181 -0
- kiapi/api/image/flux2/_views/image_response.py +53 -0
- kiapi/api/image/flux2/router.py +197 -0
- kiapi/api/image/ideogram4/_views/image_response.py +55 -0
- kiapi/api/image/ideogram4/router.py +87 -0
- kiapi/api/image/qwen/_views/image_response.py +47 -0
- kiapi/api/image/qwen/router.py +141 -0
- kiapi/api/image/seedvr2/_views/image_response.py +50 -0
- kiapi/api/image/seedvr2/router.py +83 -0
- kiapi/api/image/zimage/_views/image_response.py +49 -0
- kiapi/api/image/zimage/router.py +131 -0
- kiapi/api/jobs/_operations/get_job_id.py +18 -0
- kiapi/api/jobs/_views/job_delete_response.py +19 -0
- kiapi/api/jobs/_views/job_list_response.py +15 -0
- kiapi/api/jobs/router.py +62 -0
- kiapi/api/models/_schemas/openai_model_spec.py +26 -0
- kiapi/api/models/_views/model_list_response.py +15 -0
- kiapi/api/models/router.py +29 -0
- kiapi/api/video/ltx2/_views/__init__.py +1 -0
- kiapi/api/video/ltx2/_views/video_response.py +59 -0
- kiapi/api/video/ltx2/router.py +89 -0
- kiapi/api/web/_views/__init__.py +7 -0
- kiapi/api/web/_views/fetch_api_request.py +26 -0
- kiapi/api/web/_views/fetch_error_response.py +25 -0
- kiapi/api/web/router.py +302 -0
- kiapi/capabilities/__init__.py +24 -0
- kiapi/capabilities/_exceptions/CapabilityError.py +2 -0
- kiapi/capabilities/_exceptions/ValidationError.py +2 -0
- kiapi/capabilities/_helpers/attach_mflux_progress.py +50 -0
- kiapi/capabilities/_helpers/get_file_path.py +20 -0
- kiapi/capabilities/_helpers/resolve_file_ref.py +16 -0
- kiapi/capabilities/acestep/README.ja.md +174 -0
- kiapi/capabilities/acestep/README.md +167 -0
- kiapi/capabilities/acestep/__init__.py +37 -0
- kiapi/capabilities/acestep/_constants/description.py +122 -0
- kiapi/capabilities/acestep/_exceptions/ace_step_engine_error.py +2 -0
- kiapi/capabilities/acestep/_helpers/register.py +96 -0
- kiapi/capabilities/acestep/_models/acestep.py +105 -0
- kiapi/capabilities/acestep/_operations/handle_cover.py +23 -0
- kiapi/capabilities/acestep/_operations/handle_extract.py +38 -0
- kiapi/capabilities/acestep/_operations/handle_generate.py +18 -0
- kiapi/capabilities/acestep/_operations/handle_repaint.py +25 -0
- kiapi/capabilities/acestep/_operations/resolve_ace_step_paths.py +30 -0
- kiapi/capabilities/acestep/_operations/resolve_cover_params.py +21 -0
- kiapi/capabilities/acestep/_operations/resolve_engine.py +10 -0
- kiapi/capabilities/acestep/_operations/resolve_extract_params.py +24 -0
- kiapi/capabilities/acestep/_operations/resolve_generate_params.py +18 -0
- kiapi/capabilities/acestep/_operations/resolve_repaint_params.py +22 -0
- kiapi/capabilities/acestep/_schemas/ace_step_paths.py +29 -0
- kiapi/capabilities/acestep/_services/ace_step_engine.py +143 -0
- kiapi/capabilities/acestep/_settings.py +82 -0
- kiapi/capabilities/acestep/_views/ace_step_base.py +61 -0
- kiapi/capabilities/acestep/_views/cover_params.py +26 -0
- kiapi/capabilities/acestep/_views/cover_request.py +49 -0
- kiapi/capabilities/acestep/_views/extract_params.py +24 -0
- kiapi/capabilities/acestep/_views/extract_request.py +33 -0
- kiapi/capabilities/acestep/_views/generate_params.py +25 -0
- kiapi/capabilities/acestep/_views/generate_request.py +54 -0
- kiapi/capabilities/acestep/_views/repaint_params.py +27 -0
- kiapi/capabilities/acestep/_views/repaint_request.py +51 -0
- kiapi/capabilities/acestep/_views/track_params.py +7 -0
- kiapi/capabilities/acestep/worker_subprocess.py +247 -0
- kiapi/capabilities/audiogen/README.ja.md +49 -0
- kiapi/capabilities/audiogen/README.md +48 -0
- kiapi/capabilities/audiogen/__init__.py +25 -0
- kiapi/capabilities/audiogen/_constants/description.py +60 -0
- kiapi/capabilities/audiogen/_helpers/attach_audiogen_progress.py +27 -0
- kiapi/capabilities/audiogen/_helpers/register.py +42 -0
- kiapi/capabilities/audiogen/_helpers/validate_generate.py +14 -0
- kiapi/capabilities/audiogen/_models/audiogen.py +98 -0
- kiapi/capabilities/audiogen/_operations/handle_generate.py +27 -0
- kiapi/capabilities/audiogen/_operations/resolve_generate_params.py +25 -0
- kiapi/capabilities/audiogen/_settings.py +34 -0
- kiapi/capabilities/audiogen/_views/generate_params.py +14 -0
- kiapi/capabilities/audiogen/_views/generate_request.py +96 -0
- kiapi/capabilities/chat/README.ja.md +822 -0
- kiapi/capabilities/chat/README.md +806 -0
- kiapi/capabilities/chat/__init__.py +25 -0
- kiapi/capabilities/chat/_constants/description.py +163 -0
- kiapi/capabilities/chat/_helpers/register.py +67 -0
- kiapi/capabilities/chat/_models/qwen3_5.py +183 -0
- kiapi/capabilities/chat/_models/qwen3_omni.py +242 -0
- kiapi/capabilities/chat/_operations/apply_template.py +74 -0
- kiapi/capabilities/chat/_operations/completed_hermes_tool_call_text.py +9 -0
- kiapi/capabilities/chat/_operations/emit_streaming_response.py +297 -0
- kiapi/capabilities/chat/_operations/ensure_streaming_detokenizer_compat.py +49 -0
- kiapi/capabilities/chat/_operations/format_response.py +72 -0
- kiapi/capabilities/chat/_operations/handle_chat.py +25 -0
- kiapi/capabilities/chat/_operations/parse_hermes_tool_calls.py +63 -0
- kiapi/capabilities/chat/_operations/parse_json_tool_calls.py +66 -0
- kiapi/capabilities/chat/_operations/parse_messages.py +326 -0
- kiapi/capabilities/chat/_operations/resolve_chat_params.py +50 -0
- kiapi/capabilities/chat/_operations/stream_text_from_tokens.py +32 -0
- kiapi/capabilities/chat/_operations/strip_tool_calls.py +15 -0
- kiapi/capabilities/chat/_settings.py +74 -0
- kiapi/capabilities/chat/_utils/apply_parallel_tool_call_policy.py +17 -0
- kiapi/capabilities/chat/_utils/apply_seed.py +8 -0
- kiapi/capabilities/chat/_utils/load_audio_mono.py +31 -0
- kiapi/capabilities/chat/_utils/load_mlx_vlm.py +12 -0
- kiapi/capabilities/chat/_utils/warmup_params.py +26 -0
- kiapi/capabilities/chat/_views/chat_params.py +34 -0
- kiapi/capabilities/chat/_views/chat_request.py +153 -0
- kiapi/capabilities/depthpro/README.ja.md +131 -0
- kiapi/capabilities/depthpro/README.md +124 -0
- kiapi/capabilities/depthpro/__init__.py +23 -0
- kiapi/capabilities/depthpro/_constants/description.py +39 -0
- kiapi/capabilities/depthpro/_helpers/register.py +46 -0
- kiapi/capabilities/depthpro/_helpers/validate_estimate.py +32 -0
- kiapi/capabilities/depthpro/_models/depthpro.py +144 -0
- kiapi/capabilities/depthpro/_operations/handle_estimate.py +50 -0
- kiapi/capabilities/depthpro/_operations/is_quantize_override.py +12 -0
- kiapi/capabilities/depthpro/_operations/resolve_estimate_params.py +24 -0
- kiapi/capabilities/depthpro/_settings.py +46 -0
- kiapi/capabilities/depthpro/_views/estimate_params.py +21 -0
- kiapi/capabilities/depthpro/_views/estimate_request.py +63 -0
- kiapi/capabilities/embedding/README.ja.md +137 -0
- kiapi/capabilities/embedding/README.md +128 -0
- kiapi/capabilities/embedding/__init__.py +24 -0
- kiapi/capabilities/embedding/_constants/description.py +47 -0
- kiapi/capabilities/embedding/_helpers/register.py +66 -0
- kiapi/capabilities/embedding/_models/qwen3_text.py +53 -0
- kiapi/capabilities/embedding/_models/qwen3_vl.py +97 -0
- kiapi/capabilities/embedding/_operations/format_response.py +24 -0
- kiapi/capabilities/embedding/_operations/handle_embed.py +24 -0
- kiapi/capabilities/embedding/_operations/parse_inputs.py +108 -0
- kiapi/capabilities/embedding/_operations/resolve_embed_params.py +18 -0
- kiapi/capabilities/embedding/_settings.py +27 -0
- kiapi/capabilities/embedding/_utils/to_vector.py +20 -0
- kiapi/capabilities/embedding/_views/embed_params.py +17 -0
- kiapi/capabilities/embedding/_views/embed_request.py +39 -0
- kiapi/capabilities/ernie/README.ja.md +242 -0
- kiapi/capabilities/ernie/README.md +223 -0
- kiapi/capabilities/ernie/__init__.py +34 -0
- kiapi/capabilities/ernie/_constants/description.py +71 -0
- kiapi/capabilities/ernie/_helpers/register.py +60 -0
- kiapi/capabilities/ernie/_helpers/validate_edit.py +19 -0
- kiapi/capabilities/ernie/_helpers/validate_generate.py +8 -0
- kiapi/capabilities/ernie/_models/ernie.py +356 -0
- kiapi/capabilities/ernie/_operations/handle_edit.py +39 -0
- kiapi/capabilities/ernie/_operations/handle_generate.py +38 -0
- kiapi/capabilities/ernie/_operations/handle_train.py +77 -0
- kiapi/capabilities/ernie/_operations/is_quantize_override.py +16 -0
- kiapi/capabilities/ernie/_operations/resolve_edit_params.py +44 -0
- kiapi/capabilities/ernie/_operations/resolve_generate_params.py +40 -0
- kiapi/capabilities/ernie/_operations/resolve_lora_params.py +23 -0
- kiapi/capabilities/ernie/_operations/resolve_train_params.py +43 -0
- kiapi/capabilities/ernie/_operations/validate_common.py +33 -0
- kiapi/capabilities/ernie/_schemas/lora_ref.py +27 -0
- kiapi/capabilities/ernie/_settings.py +151 -0
- kiapi/capabilities/ernie/_views/edit_params.py +36 -0
- kiapi/capabilities/ernie/_views/edit_request.py +142 -0
- kiapi/capabilities/ernie/_views/generate_params.py +32 -0
- kiapi/capabilities/ernie/_views/generate_request.py +127 -0
- kiapi/capabilities/ernie/_views/train_params.py +28 -0
- kiapi/capabilities/ernie/_views/train_request.py +96 -0
- kiapi/capabilities/flux2/README.ja.md +260 -0
- kiapi/capabilities/flux2/README.md +241 -0
- kiapi/capabilities/flux2/__init__.py +36 -0
- kiapi/capabilities/flux2/_constants/description.py +81 -0
- kiapi/capabilities/flux2/_helpers/register.py +98 -0
- kiapi/capabilities/flux2/_helpers/validate_edit.py +12 -0
- kiapi/capabilities/flux2/_helpers/validate_generate.py +8 -0
- kiapi/capabilities/flux2/_models/flux2.py +396 -0
- kiapi/capabilities/flux2/_operations/handle_edit.py +44 -0
- kiapi/capabilities/flux2/_operations/handle_generate.py +46 -0
- kiapi/capabilities/flux2/_operations/handle_train.py +105 -0
- kiapi/capabilities/flux2/_operations/is_quantize_override.py +16 -0
- kiapi/capabilities/flux2/_operations/resolve_edit_params.py +43 -0
- kiapi/capabilities/flux2/_operations/resolve_generate_params.py +44 -0
- kiapi/capabilities/flux2/_operations/resolve_lora_params.py +23 -0
- kiapi/capabilities/flux2/_operations/resolve_train_params.py +42 -0
- kiapi/capabilities/flux2/_operations/role_spec.py +13 -0
- kiapi/capabilities/flux2/_operations/split_repo.py +11 -0
- kiapi/capabilities/flux2/_operations/validate_common.py +35 -0
- kiapi/capabilities/flux2/_schemas/lora_ref.py +27 -0
- kiapi/capabilities/flux2/_settings.py +181 -0
- kiapi/capabilities/flux2/_views/edit_params.py +36 -0
- kiapi/capabilities/flux2/_views/edit_request.py +145 -0
- kiapi/capabilities/flux2/_views/generate_params.py +36 -0
- kiapi/capabilities/flux2/_views/generate_request.py +150 -0
- kiapi/capabilities/flux2/_views/train_params.py +32 -0
- kiapi/capabilities/flux2/_views/train_request.py +102 -0
- kiapi/capabilities/ideogram4/README.ja.md +230 -0
- kiapi/capabilities/ideogram4/README.md +219 -0
- kiapi/capabilities/ideogram4/__init__.py +24 -0
- kiapi/capabilities/ideogram4/_constants/description.py +65 -0
- kiapi/capabilities/ideogram4/_helpers/register.py +44 -0
- kiapi/capabilities/ideogram4/_helpers/validate_generate.py +31 -0
- kiapi/capabilities/ideogram4/_models/ideogram4.py +120 -0
- kiapi/capabilities/ideogram4/_operations/handle_generate.py +30 -0
- kiapi/capabilities/ideogram4/_operations/is_quantize_override.py +12 -0
- kiapi/capabilities/ideogram4/_operations/resolve_generate_params.py +30 -0
- kiapi/capabilities/ideogram4/_settings.py +89 -0
- kiapi/capabilities/ideogram4/_views/generate_params.py +27 -0
- kiapi/capabilities/ideogram4/_views/generate_request.py +118 -0
- kiapi/capabilities/ltx2/README.ja.md +287 -0
- kiapi/capabilities/ltx2/README.md +274 -0
- kiapi/capabilities/ltx2/__init__.py +26 -0
- kiapi/capabilities/ltx2/_constants/description.py +81 -0
- kiapi/capabilities/ltx2/_helpers/register.py +58 -0
- kiapi/capabilities/ltx2/_helpers/validate_generate.py +42 -0
- kiapi/capabilities/ltx2/_models/ltx2.py +106 -0
- kiapi/capabilities/ltx2/_operations/detect_mode.py +19 -0
- kiapi/capabilities/ltx2/_operations/handle_generate.py +52 -0
- kiapi/capabilities/ltx2/_operations/resolve_generate_params.py +31 -0
- kiapi/capabilities/ltx2/_settings.py +93 -0
- kiapi/capabilities/ltx2/_views/generate_params.py +34 -0
- kiapi/capabilities/ltx2/_views/generate_request.py +151 -0
- kiapi/capabilities/qwen/README.ja.md +251 -0
- kiapi/capabilities/qwen/README.md +235 -0
- kiapi/capabilities/qwen/__init__.py +30 -0
- kiapi/capabilities/qwen/_constants/description.py +53 -0
- kiapi/capabilities/qwen/_helpers/register.py +60 -0
- kiapi/capabilities/qwen/_helpers/validate_edit.py +12 -0
- kiapi/capabilities/qwen/_helpers/validate_generate.py +12 -0
- kiapi/capabilities/qwen/_models/qwen.py +224 -0
- kiapi/capabilities/qwen/_operations/handle_edit.py +44 -0
- kiapi/capabilities/qwen/_operations/handle_generate.py +46 -0
- kiapi/capabilities/qwen/_operations/is_quantize_override.py +15 -0
- kiapi/capabilities/qwen/_operations/resolve_edit_params.py +35 -0
- kiapi/capabilities/qwen/_operations/resolve_generate_params.py +39 -0
- kiapi/capabilities/qwen/_operations/resolve_lora_params.py +23 -0
- kiapi/capabilities/qwen/_operations/validate_common.py +32 -0
- kiapi/capabilities/qwen/_schemas/lora_ref.py +27 -0
- kiapi/capabilities/qwen/_settings.py +107 -0
- kiapi/capabilities/qwen/_views/edit_params.py +36 -0
- kiapi/capabilities/qwen/_views/edit_request.py +138 -0
- kiapi/capabilities/qwen/_views/generate_params.py +37 -0
- kiapi/capabilities/qwen/_views/generate_request.py +149 -0
- kiapi/capabilities/seedvr2/README.ja.md +234 -0
- kiapi/capabilities/seedvr2/README.md +219 -0
- kiapi/capabilities/seedvr2/__init__.py +24 -0
- kiapi/capabilities/seedvr2/_constants/description.py +46 -0
- kiapi/capabilities/seedvr2/_helpers/register.py +60 -0
- kiapi/capabilities/seedvr2/_helpers/validate_upscale.py +52 -0
- kiapi/capabilities/seedvr2/_models/seedvr2.py +140 -0
- kiapi/capabilities/seedvr2/_operations/handle_upscale.py +42 -0
- kiapi/capabilities/seedvr2/_operations/is_quantize_override.py +12 -0
- kiapi/capabilities/seedvr2/_operations/resolve_upscale_params.py +30 -0
- kiapi/capabilities/seedvr2/_settings.py +74 -0
- kiapi/capabilities/seedvr2/_views/upscale_params.py +27 -0
- kiapi/capabilities/seedvr2/_views/upscale_request.py +94 -0
- kiapi/capabilities/web/README.ja.md +187 -0
- kiapi/capabilities/web/README.md +171 -0
- kiapi/capabilities/web/__init__.py +30 -0
- kiapi/capabilities/web/_constants/description.py +38 -0
- kiapi/capabilities/web/_exceptions/FetchError.py +24 -0
- kiapi/capabilities/web/_exceptions/SearchBackendError.py +11 -0
- kiapi/capabilities/web/_helpers/register.py +59 -0
- kiapi/capabilities/web/_models/crawl4ai.py +32 -0
- kiapi/capabilities/web/_models/searxng.py +44 -0
- kiapi/capabilities/web/_operations/handle_fetch.py +145 -0
- kiapi/capabilities/web/_operations/handle_search.py +56 -0
- kiapi/capabilities/web/_operations/resolve_fetch_params.py +19 -0
- kiapi/capabilities/web/_operations/resolve_search_params.py +34 -0
- kiapi/capabilities/web/_operations/resolve_searxng_config_dir.py +21 -0
- kiapi/capabilities/web/_services/__init__.py +1 -0
- kiapi/capabilities/web/_services/web_backend_process.py +144 -0
- kiapi/capabilities/web/_settings.py +138 -0
- kiapi/capabilities/web/_views/fetch_params.py +27 -0
- kiapi/capabilities/web/_views/fetch_request.py +29 -0
- kiapi/capabilities/web/_views/fetch_result.py +20 -0
- kiapi/capabilities/web/_views/search_params.py +43 -0
- kiapi/capabilities/web/_views/search_request.py +93 -0
- kiapi/capabilities/web/_views/search_response.py +49 -0
- kiapi/capabilities/web/resources/__init__.py +0 -0
- kiapi/capabilities/web/resources/searxng/__init__.py +0 -0
- kiapi/capabilities/web/resources/searxng/settings.yml +11 -0
- kiapi/capabilities/zimage/README.ja.md +249 -0
- kiapi/capabilities/zimage/README.md +231 -0
- kiapi/capabilities/zimage/__init__.py +34 -0
- kiapi/capabilities/zimage/_constants/description.py +73 -0
- kiapi/capabilities/zimage/_helpers/register.py +62 -0
- kiapi/capabilities/zimage/_helpers/validate_generate.py +37 -0
- kiapi/capabilities/zimage/_models/zimage.py +278 -0
- kiapi/capabilities/zimage/_operations/handle_generate.py +38 -0
- kiapi/capabilities/zimage/_operations/handle_train.py +78 -0
- kiapi/capabilities/zimage/_operations/is_quantize_override.py +11 -0
- kiapi/capabilities/zimage/_operations/resolve_generate_params.py +39 -0
- kiapi/capabilities/zimage/_operations/resolve_lora_params.py +23 -0
- kiapi/capabilities/zimage/_operations/resolve_train_params.py +38 -0
- kiapi/capabilities/zimage/_schemas/lora_ref.py +27 -0
- kiapi/capabilities/zimage/_settings.py +166 -0
- kiapi/capabilities/zimage/_views/generate_params.py +23 -0
- kiapi/capabilities/zimage/_views/generate_request.py +127 -0
- kiapi/capabilities/zimage/_views/train_params.py +22 -0
- kiapi/capabilities/zimage/_views/train_request.py +101 -0
- kiapi/cli/__init__.py +11 -0
- kiapi/cli/_helpers/dedupe_resources.py +12 -0
- kiapi/cli/_helpers/register_all_capabilities.py +36 -0
- kiapi/cli/_helpers/run_resources.py +24 -0
- kiapi/cli/_helpers/select_specs.py +67 -0
- kiapi/cli/activate/_operations/preflight_hf_access.py +129 -0
- kiapi/cli/activate/cli.py +37 -0
- kiapi/cli/check/_helpers/check_audio_acestep_turbo.py +22 -0
- kiapi/cli/check/_helpers/check_audio_acestep_xl_base.py +22 -0
- kiapi/cli/check/_helpers/check_audio_audiogen_medium.py +24 -0
- kiapi/cli/check/_helpers/check_chat_chat_qwen3_6_27b.py +19 -0
- kiapi/cli/check/_helpers/check_chat_chat_qwen3_omni.py +19 -0
- kiapi/cli/check/_helpers/check_embedding_embedding_qwen3_embedding_8b.py +14 -0
- kiapi/cli/check/_helpers/check_embedding_embedding_qwen3_vl_embedding_2b.py +19 -0
- kiapi/cli/check/_helpers/check_image_depthpro_base.py +21 -0
- kiapi/cli/check/_helpers/check_image_ernie_base.py +23 -0
- kiapi/cli/check/_helpers/check_image_ernie_turbo.py +23 -0
- kiapi/cli/check/_helpers/check_image_flux2_klein_9b.py +23 -0
- kiapi/cli/check/_helpers/check_image_flux2_klein_base_4b.py +23 -0
- kiapi/cli/check/_helpers/check_image_flux2_klein_base_9b.py +23 -0
- kiapi/cli/check/_helpers/check_image_ideogram4_fp8.py +23 -0
- kiapi/cli/check/_helpers/check_image_qwen_edit_2509.py +27 -0
- kiapi/cli/check/_helpers/check_image_qwen_image.py +23 -0
- kiapi/cli/check/_helpers/check_image_seedvr2_3b.py +23 -0
- kiapi/cli/check/_helpers/check_image_seedvr2_7b.py +23 -0
- kiapi/cli/check/_helpers/check_image_zimage_base.py +23 -0
- kiapi/cli/check/_helpers/check_image_zimage_turbo.py +23 -0
- kiapi/cli/check/_helpers/check_video_ltx2_distilled.py +26 -0
- kiapi/cli/check/_helpers/check_web_web_fetch.py +14 -0
- kiapi/cli/check/_helpers/check_web_web_search.py +14 -0
- kiapi/cli/check/_operations/build_check_result.py +20 -0
- kiapi/cli/check/_operations/check_context.py +10 -0
- kiapi/cli/check/_operations/create_sample_image.py +46 -0
- kiapi/cli/check/_schemas/check_result.py +12 -0
- kiapi/cli/check/cli.py +89 -0
- kiapi/cli/cli.py +29 -0
- kiapi/cli/config/cli.py +17 -0
- kiapi/cli/config/edit/cli.py +32 -0
- kiapi/cli/config/init/cli.py +33 -0
- kiapi/cli/config/show/cli.py +13 -0
- kiapi/cli/config/template/cli.py +36 -0
- kiapi/cli/deactivate/cli.py +49 -0
- kiapi/cli/run/asgi.py +16 -0
- kiapi/cli/run/cli.py +59 -0
- kiapi/cli/service/__init__.py +5 -0
- kiapi/cli/service/_services/service_manager.py +107 -0
- kiapi/cli/service/cli.py +19 -0
- kiapi/cli/service/install/cli.py +17 -0
- kiapi/cli/service/start/cli.py +22 -0
- kiapi/cli/service/status/cli.py +81 -0
- kiapi/cli/service/stop/cli.py +19 -0
- kiapi/cli/service/uninstall/cli.py +16 -0
- kiapi/cli/status/cli.py +226 -0
- kiapi/core/app/__init__.py +16 -0
- kiapi/core/app/_schemas/app_context.py +28 -0
- kiapi/core/app/_services/user_directory.py +59 -0
- kiapi/core/app/_settings.py +46 -0
- kiapi/core/capability/__init__.py +11 -0
- kiapi/core/capability/_schemas/capability_spec.py +17 -0
- kiapi/core/capability/_services/capability_spec_registry.py +21 -0
- kiapi/core/config/__init__.py +11 -0
- kiapi/core/config/_exceptions/user_config_error.py +2 -0
- kiapi/core/config/_helpers/get_user_settings_path.py +7 -0
- kiapi/core/config/_helpers/load_user_settings.py +54 -0
- kiapi/core/file/__init__.py +37 -0
- kiapi/core/file/_helpers/create_file_store.py +7 -0
- kiapi/core/file/_helpers/resolve_file_ref.py +90 -0
- kiapi/core/file/_schemas/file_data_url_ref.py +19 -0
- kiapi/core/file/_schemas/file_id_ref.py +16 -0
- kiapi/core/file/_schemas/file_record.py +46 -0
- kiapi/core/file/_schemas/file_url_ref.py +16 -0
- kiapi/core/file/_services/file_store.py +138 -0
- kiapi/core/file/_settings.py +22 -0
- kiapi/core/file/_types/file_id.py +2 -0
- kiapi/core/file/_types/file_ref.py +12 -0
- kiapi/core/file/_views/resolved_file_ref.py +16 -0
- kiapi/core/job/__init__.py +24 -0
- kiapi/core/job/_enums/job_status.py +9 -0
- kiapi/core/job/_helpers/creep_progress.py +123 -0
- kiapi/core/job/_models/job.py +121 -0
- kiapi/core/job/_services/job_store.py +33 -0
- kiapi/core/job/_services/progress_reporter.py +79 -0
- kiapi/core/job/_types/job_id.py +3 -0
- kiapi/core/job/_types/job_result.py +5 -0
- kiapi/core/job/_types/job_type.py +4 -0
- kiapi/core/logging/__init__.py +14 -0
- kiapi/core/logging/_helpers/get_log_level.py +8 -0
- kiapi/core/logging/_helpers/setup_logger.py +14 -0
- kiapi/core/logging/_settings.py +34 -0
- kiapi/core/logging/_types/log_level.py +3 -0
- kiapi/core/memory/__init__.py +21 -0
- kiapi/core/memory/_exceptions/memory_budget_error.py +2 -0
- kiapi/core/memory/_helpers/create_memory_manager.py +17 -0
- kiapi/core/memory/_operations/log_memory_limit.py +29 -0
- kiapi/core/memory/_operations/resolve_effective_memory_limit_gb.py +13 -0
- kiapi/core/memory/_operations/resolve_framework_strategy.py +42 -0
- kiapi/core/memory/_schemas/framework_strategy.py +14 -0
- kiapi/core/memory/_schemas/memory_stats.py +24 -0
- kiapi/core/memory/_schemas/resident_model.py +14 -0
- kiapi/core/memory/_schemas/resident_model_stats.py +49 -0
- kiapi/core/memory/_services/memory_manager.py +257 -0
- kiapi/core/memory/_settings.py +36 -0
- kiapi/core/memory/_types/framework_name.py +4 -0
- kiapi/core/memory/_types/resident_key.py +4 -0
- kiapi/core/model/__init__.py +36 -0
- kiapi/core/model/_exceptions/unknown_model_error.py +2 -0
- kiapi/core/model/_schemas/model_spec.py +145 -0
- kiapi/core/model/_services/model_registry.py +85 -0
- kiapi/core/model/_types/model_alias.py +2 -0
- kiapi/core/model/_types/model_domain.py +6 -0
- kiapi/core/model/_types/model_family.py +5 -0
- kiapi/core/model/_types/model_key.py +8 -0
- kiapi/core/model/_types/model_name.py +4 -0
- kiapi/core/model/_types/model_repo.py +3 -0
- kiapi/core/net/__init__.py +16 -0
- kiapi/core/net/_exceptions/unsafe_url_error.py +7 -0
- kiapi/core/net/_helpers/verify_public_url.py +68 -0
- kiapi/core/net/_settings.py +28 -0
- kiapi/core/setup/__init__.py +25 -0
- kiapi/core/setup/_exceptions/setup_required_error.py +2 -0
- kiapi/core/setup/_schemas/docker_image_resource.py +37 -0
- kiapi/core/setup/_schemas/hf_snapshot_resource.py +50 -0
- kiapi/core/setup/_schemas/local_path_resource.py +43 -0
- kiapi/core/setup/_schemas/python_package_resource.py +58 -0
- kiapi/core/setup/_schemas/python_venv_resource.py +63 -0
- kiapi/core/setup/_schemas/setup_status.py +7 -0
- kiapi/core/setup/_schemas/url_file_resource.py +43 -0
- kiapi/core/setup/_services/setup_manager.py +331 -0
- kiapi/core/setup/_types/setup_resource.py +21 -0
- kiapi/core/setup/_types/setup_target.py +11 -0
- kiapi/core/workdir/__init__.py +8 -0
- kiapi/core/workdir/_helpers/create_work_dir.py +11 -0
- kiapi/core/workdir/_settings.py +21 -0
- kiapi/core/worker/__init__.py +23 -0
- kiapi/core/worker/_helpers/create_worker.py +9 -0
- kiapi/core/worker/_services/worker.py +165 -0
- kiapi/core/worker/_settings.py +36 -0
- kiapi/core/worker/_types/job_thunk.py +6 -0
- kiapi-0.1.0.dist-info/METADATA +337 -0
- kiapi-0.1.0.dist-info/RECORD +465 -0
- kiapi-0.1.0.dist-info/WHEEL +4 -0
- kiapi-0.1.0.dist-info/entry_points.txt +2 -0
- kiapi-0.1.0.dist-info/licenses/LICENSE +21 -0
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"""The complete contract for one Ideogram 4 txt2img run.
|
|
2
|
+
|
|
3
|
+
Built from settings + request by ``resolve_generate_params``; the model needs
|
|
4
|
+
nothing else to produce the image and its metadata.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
from typing import Any, Literal
|
|
8
|
+
|
|
9
|
+
from pydantic import BaseModel
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class GenerateParams(BaseModel):
|
|
13
|
+
kind: Literal["txt2img"] = "txt2img"
|
|
14
|
+
model: str
|
|
15
|
+
|
|
16
|
+
prompt: str | dict[str, Any]
|
|
17
|
+
preset: str
|
|
18
|
+
|
|
19
|
+
seed: int
|
|
20
|
+
width: int
|
|
21
|
+
height: int
|
|
22
|
+
quantize: int | None
|
|
23
|
+
strict_caption_validation: bool
|
|
24
|
+
warn_on_caption_issues: bool
|
|
25
|
+
|
|
26
|
+
format: Literal["png", "jpeg", "webp"]
|
|
27
|
+
quality: int
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
"""Ideogram 4 text-to-image request model.
|
|
2
|
+
|
|
3
|
+
One endpoint serves both sync and async via ``mode``. Ideogram 4 is typography-
|
|
4
|
+
focused txt2img: a structured JSON caption (`prompt`) gives the best results,
|
|
5
|
+
though plain text is accepted. A ``quantize`` override builds a one-off transient
|
|
6
|
+
model (slower, not reused); otherwise the resident model is used.
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
from typing import Any, Literal
|
|
10
|
+
|
|
11
|
+
from pydantic import BaseModel, ConfigDict, Field
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class GenerateRequest(BaseModel):
|
|
15
|
+
model_config = ConfigDict(extra="allow")
|
|
16
|
+
|
|
17
|
+
model: str | None = Field(
|
|
18
|
+
default=None,
|
|
19
|
+
description=(
|
|
20
|
+
"Model variant (see GET /v1/image/ideogram4/models). Only `fp8` exists; "
|
|
21
|
+
"omit to use it. Aliases `ideogram4` / `ideogram-4` are accepted."
|
|
22
|
+
),
|
|
23
|
+
)
|
|
24
|
+
mode: Literal["sync", "async"] = Field(
|
|
25
|
+
default="sync",
|
|
26
|
+
description=(
|
|
27
|
+
"`sync` waits for the image (504 on timeout); `async` returns 202 with "
|
|
28
|
+
"a job_id immediately — poll GET /v1/jobs/{job_id}."
|
|
29
|
+
),
|
|
30
|
+
)
|
|
31
|
+
|
|
32
|
+
# Ideogram 4 works best with a structured JSON caption, but mflux also
|
|
33
|
+
# accepts plain text prompts. Keep both forms available to callers.
|
|
34
|
+
prompt: str | dict[str, Any] = Field(
|
|
35
|
+
...,
|
|
36
|
+
description=(
|
|
37
|
+
"What to generate. Prefer a structured JSON caption with "
|
|
38
|
+
"`high_level_description`, optional `style_description`, and "
|
|
39
|
+
"`compositional_deconstruction` (`background` + `elements`, each with "
|
|
40
|
+
"`type` text|obj, `bbox` [x1,y1,x2,y2] in 0-1000 layout coords, `text` "
|
|
41
|
+
"for text elements, and `desc`). Plain text is accepted but usually "
|
|
42
|
+
"weaker for typography. Must not be empty."
|
|
43
|
+
),
|
|
44
|
+
)
|
|
45
|
+
preset: Literal["V4_DEFAULT_20", "V4_QUALITY_48", "V4_TURBO_12"] = Field(
|
|
46
|
+
default="V4_DEFAULT_20",
|
|
47
|
+
description=(
|
|
48
|
+
"Sampler preset bundling steps, guidance schedule, and noise schedule. "
|
|
49
|
+
"`V4_TURBO_12` is fastest (12 steps), `V4_DEFAULT_20` is balanced, "
|
|
50
|
+
"`V4_QUALITY_48` is highest quality and slowest (48 steps)."
|
|
51
|
+
),
|
|
52
|
+
)
|
|
53
|
+
|
|
54
|
+
width: int | None = Field(
|
|
55
|
+
default=None,
|
|
56
|
+
description=(
|
|
57
|
+
"Output width in pixels. Omit for the server default (1024). Must be a "
|
|
58
|
+
"multiple of 16 and within 256..2048."
|
|
59
|
+
),
|
|
60
|
+
)
|
|
61
|
+
height: int | None = Field(
|
|
62
|
+
default=None,
|
|
63
|
+
description=(
|
|
64
|
+
"Output height in pixels. Omit for the server default (1024). Must be a "
|
|
65
|
+
"multiple of 16 and within 256..2048."
|
|
66
|
+
),
|
|
67
|
+
)
|
|
68
|
+
seed: int | None = Field(
|
|
69
|
+
default=None,
|
|
70
|
+
description=(
|
|
71
|
+
"Random seed for reproducibility. Omit for a random seed (the resolved "
|
|
72
|
+
"seed is recorded in the result `params`)."
|
|
73
|
+
),
|
|
74
|
+
)
|
|
75
|
+
quantize: int | None = Field(
|
|
76
|
+
default=None,
|
|
77
|
+
description=(
|
|
78
|
+
"Quantization bits, one of {3, 4, 5, 6, 8}. Omit to use the resident "
|
|
79
|
+
"model's quantization. A differing value builds a one-off transient "
|
|
80
|
+
"model (slower, not reused)."
|
|
81
|
+
),
|
|
82
|
+
)
|
|
83
|
+
strict_caption_validation: bool = Field(
|
|
84
|
+
default=False,
|
|
85
|
+
description=(
|
|
86
|
+
"If true, fail the request (400) when mflux reports JSON-caption schema "
|
|
87
|
+
"warnings instead of proceeding."
|
|
88
|
+
),
|
|
89
|
+
)
|
|
90
|
+
warn_on_caption_issues: bool = Field(
|
|
91
|
+
default=True,
|
|
92
|
+
description="Ask mflux to surface warnings about JSON-caption schema issues.",
|
|
93
|
+
)
|
|
94
|
+
|
|
95
|
+
format: Literal["png", "jpeg", "webp"] = Field(
|
|
96
|
+
default="png",
|
|
97
|
+
description="Output image encoding for the produced file.",
|
|
98
|
+
)
|
|
99
|
+
quality: int = Field(
|
|
100
|
+
default=90,
|
|
101
|
+
ge=1,
|
|
102
|
+
le=100,
|
|
103
|
+
description="Encoder quality 1..100 (used for jpeg/webp; ignored for png).",
|
|
104
|
+
)
|
|
105
|
+
|
|
106
|
+
def gen_params(self) -> dict:
|
|
107
|
+
return {
|
|
108
|
+
"prompt": self.prompt,
|
|
109
|
+
"preset": self.preset,
|
|
110
|
+
"width": self.width,
|
|
111
|
+
"height": self.height,
|
|
112
|
+
"seed": self.seed,
|
|
113
|
+
"quantize": self.quantize,
|
|
114
|
+
"strict_caption_validation": self.strict_caption_validation,
|
|
115
|
+
"warn_on_caption_issues": self.warn_on_caption_issues,
|
|
116
|
+
"format": self.format,
|
|
117
|
+
"quality": self.quality,
|
|
118
|
+
}
|
|
@@ -0,0 +1,287 @@
|
|
|
1
|
+
# ltx2
|
|
2
|
+
|
|
3
|
+
[English](README.md) | **日本語**
|
|
4
|
+
|
|
5
|
+
[mlx-video LTX-2](https://github.com/Blaizzy/mlx-video) で、短尺動画生成機能を提供します。
|
|
6
|
+
|
|
7
|
+
- **T2V**: テキストから動画を生成
|
|
8
|
+
- **I2V**: 画像を最初または最後のフレームとして動画化
|
|
9
|
+
- **A2V**: 音声でモーションやタイミングを駆動
|
|
10
|
+
- **T2V + Audio**: 動画とあわせて音声を生成
|
|
11
|
+
|
|
12
|
+
## API
|
|
13
|
+
|
|
14
|
+
| Endpoint | Name | Description |
|
|
15
|
+
|---|---|---|
|
|
16
|
+
| `POST /v1/video/ltx2/generate` | 動画生成 | JSON body と任意の `image` / `end_image` / `audio` FileRef から MP4 を生成。 |
|
|
17
|
+
| `GET /v1/video/ltx2/models` | モデル一覧 | 利用可能なモデルの一覧を返す。 |
|
|
18
|
+
| `GET /v1/video/ltx2/openapi.json` | OpenAPI | 詳細な入出力仕様、使い方、TIPS を返す。 |
|
|
19
|
+
|
|
20
|
+
推論されるモード:
|
|
21
|
+
|
|
22
|
+
| 入力 | モード |
|
|
23
|
+
|---|---|
|
|
24
|
+
| ファイル添付なし | T2V — テキストから動画 |
|
|
25
|
+
| `image` FileRef | I2V — 最初のフレームをアニメ化 |
|
|
26
|
+
| `image` + `end_image` FileRef | I2V — 最初と最後のフレームを指定 |
|
|
27
|
+
| `end_image` FileRef | I2V — 最後のフレームを指定 |
|
|
28
|
+
| `audio` FileRef | A2V — 音声でモーション/タイミングを駆動 |
|
|
29
|
+
| `image` + `audio` FileRef | A2V + I2V |
|
|
30
|
+
| `generate_audio: true` | T2V + Audio — 音声も生成 |
|
|
31
|
+
|
|
32
|
+
- `mode: "sync"` は完了まで待ち、単一成果物なら既定で生の MP4 バイト列を返します。
|
|
33
|
+
Job JSON が欲しい場合は `Accept: application/json` を付けます。
|
|
34
|
+
- `mode: "async"` は `202` と `{job_id}` を返します。
|
|
35
|
+
`GET /v1/jobs/{job_id}` で進捗を確認し、完了後に `result.file_id` または
|
|
36
|
+
`artifacts[0]` で MP4 を取得します。
|
|
37
|
+
- `audio` ファイルと `generate_audio: true` は排他です。
|
|
38
|
+
|
|
39
|
+
## API Docs
|
|
40
|
+
|
|
41
|
+
- [OpenAPI JSON](https://kiarina.github.io/kiapi/v1/video/ltx2/openapi.json)
|
|
42
|
+
- [Swagger UI](https://kiarina.github.io/kiapi/v1/video/ltx2/docs.html)
|
|
43
|
+
- [ReDoc](https://kiarina.github.io/kiapi/v1/video/ltx2/redoc.html)
|
|
44
|
+
|
|
45
|
+
## Dependencies
|
|
46
|
+
|
|
47
|
+
| Package | License | Description |
|
|
48
|
+
|---|---|---|
|
|
49
|
+
| [mlx-video](https://github.com/Blaizzy/mlx-video) | MIT | LTX-2 distilled パイプラインを MLX 上で実行。`pyproject.toml` では既知良好な git commit にピンしている。 |
|
|
50
|
+
|
|
51
|
+
## Models
|
|
52
|
+
|
|
53
|
+
| Model | License | Terms | Size | Description |
|
|
54
|
+
|---|---|---|---:|---|
|
|
55
|
+
| [prince-canuma/LTX-2-distilled](https://huggingface.co/prince-canuma/LTX-2-distilled) | [LTX-2 Community License Agreement](https://huggingface.co/Lightricks/LTX-2/blob/main/LICENSE)(派生元 [Lightricks/LTX-2](https://huggingface.co/Lightricks/LTX-2) に準拠。repo 自体は model card / LICENSE 未記載) | HF gated なし。ただし使用・配布によりライセンス同意 | 101 GB | `distilled`(デフォルト)。2 段 distilled パイプライン。CFG なし、内部約 11 ステップ。呼び出しごとにロード/解放する transient モデル。 |
|
|
56
|
+
|
|
57
|
+
主な既定値と上限:
|
|
58
|
+
|
|
59
|
+
| 項目 | 既定値 | 制約 |
|
|
60
|
+
|---|---:|---|
|
|
61
|
+
| `width` | `512` | 正の 64 の倍数。上限 `768`。 |
|
|
62
|
+
| `height` | `512` | 正の 64 の倍数。上限 `768`。 |
|
|
63
|
+
| `num_frames` | `97` | `1 + 8*k`。上限 `721`。 |
|
|
64
|
+
| `fps` | `24` | 正の整数。 |
|
|
65
|
+
| `image_strength` | `1.0` | `0.0..1.0`。I2V の入力フレームへの拘束度。 |
|
|
66
|
+
|
|
67
|
+
`duration = num_frames / fps` です。24 fps では `97` が約 4 秒、`161` が約 6.7 秒、
|
|
68
|
+
`241` が約 10 秒、`481` が約 20 秒、`721` が約 30 秒です。
|
|
69
|
+
|
|
70
|
+
## Notes
|
|
71
|
+
|
|
72
|
+
- **transient モデル**:
|
|
73
|
+
LTX-2 は常駐モデルではありません。呼び出しごとにロード・生成・解放し、実行前に
|
|
74
|
+
`memory.reserve()` で約 40 GB の一時メモリ予算を確保します。そのため `/health` の
|
|
75
|
+
resident model には残りません。
|
|
76
|
+
- **レスポンス形式**:
|
|
77
|
+
sync で MP4 が 1 つだけ生成される場合、既定では生の MP4 を返します。
|
|
78
|
+
`X-Kiapi-File-Id` / `X-Kiapi-Job-Id` ヘッダから metadata を辿れます。
|
|
79
|
+
`Accept: application/json` を付けると Job JSON を返します。
|
|
80
|
+
- **distilled は negative guidance を持たない**:
|
|
81
|
+
classifier-free guidance がないため、negative prompt や `no zoom` / `don't ...`
|
|
82
|
+
のような抑制指示は効きません。避けたいものではなく、欲しい動き・構図・質感を
|
|
83
|
+
書き、seed や `image_strength` で調整します。
|
|
84
|
+
- **I2V の `image_strength`**:
|
|
85
|
+
`1.0` は入力フレームに強く固定されます。はっきり動かしたい場合は `0.7` 前後まで
|
|
86
|
+
下げると変化を許しやすくなります。
|
|
87
|
+
- **進捗**:
|
|
88
|
+
mlx-video はステップ単位の進捗コールバックを公開していません。kiapi は
|
|
89
|
+
`progress_eta_base_s` を基準に、フレーム数と解像度でスケールした時間ベースの
|
|
90
|
+
synthetic progress を流します。
|
|
91
|
+
- **依存更新時の注意**:
|
|
92
|
+
`mlx-video` は API が変わりやすいため git commit にピンしています。更新時は
|
|
93
|
+
`_models/ltx2.py` の `generate_video` 呼び出しと `PipelineType.DISTILLED` の経路を
|
|
94
|
+
確認し、`make verify-ltx2` で実機検証してください。
|
|
95
|
+
|
|
96
|
+
## Quickstart
|
|
97
|
+
|
|
98
|
+
### generate — T2V
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
PARAMS=$(
|
|
102
|
+
jq -n \
|
|
103
|
+
--arg prompt "a cat walking through tall grass, sunny, shallow depth of field" \
|
|
104
|
+
'{
|
|
105
|
+
model: "distilled",
|
|
106
|
+
mode: "sync",
|
|
107
|
+
prompt: $prompt,
|
|
108
|
+
width: 512,
|
|
109
|
+
height: 512,
|
|
110
|
+
num_frames: 97,
|
|
111
|
+
fps: 24,
|
|
112
|
+
seed: 1
|
|
113
|
+
}'
|
|
114
|
+
)
|
|
115
|
+
|
|
116
|
+
curl -sS -X POST http://localhost:${PORT:-8000}/v1/video/ltx2/generate \
|
|
117
|
+
-H 'Content-Type: application/json' \
|
|
118
|
+
--data-binary "$PARAMS" \
|
|
119
|
+
-o ltx2.mp4
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
Job JSON が欲しい場合:
|
|
123
|
+
|
|
124
|
+
```bash
|
|
125
|
+
PARAMS=$(
|
|
126
|
+
jq -n \
|
|
127
|
+
--arg prompt "a small paper boat floating on a quiet pond, gentle ripples" \
|
|
128
|
+
'{
|
|
129
|
+
mode: "sync",
|
|
130
|
+
prompt: $prompt,
|
|
131
|
+
width: 512,
|
|
132
|
+
height: 512,
|
|
133
|
+
num_frames: 97,
|
|
134
|
+
seed: 2
|
|
135
|
+
}'
|
|
136
|
+
)
|
|
137
|
+
|
|
138
|
+
curl -sS -X POST http://localhost:${PORT:-8000}/v1/video/ltx2/generate \
|
|
139
|
+
-H 'Accept: application/json' \
|
|
140
|
+
-H 'Content-Type: application/json' \
|
|
141
|
+
--data-binary "$PARAMS" | jq .
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
### generate — I2V
|
|
145
|
+
|
|
146
|
+
最初のフレームに使う画像を Files API にアップロードして参照します。
|
|
147
|
+
|
|
148
|
+
```bash
|
|
149
|
+
IMAGE_ID=$(curl -sS -X POST http://localhost:${PORT:-8000}/v1/files \
|
|
150
|
+
-F "file=@first_frame.png;type=image/png" | jq -r .file_id)
|
|
151
|
+
|
|
152
|
+
PARAMS=$(
|
|
153
|
+
jq -n \
|
|
154
|
+
--arg image "$IMAGE_ID" \
|
|
155
|
+
--arg prompt "gentle wind, leaves moving, soft cinematic motion" \
|
|
156
|
+
'{
|
|
157
|
+
mode: "sync",
|
|
158
|
+
prompt: $prompt,
|
|
159
|
+
image: {type: "file_id", file_id: $image},
|
|
160
|
+
num_frames: 97,
|
|
161
|
+
image_strength: 0.7,
|
|
162
|
+
seed: 3
|
|
163
|
+
}'
|
|
164
|
+
)
|
|
165
|
+
|
|
166
|
+
curl -sS -X POST http://localhost:${PORT:-8000}/v1/video/ltx2/generate \
|
|
167
|
+
-H 'Content-Type: application/json' \
|
|
168
|
+
--data-binary "$PARAMS" \
|
|
169
|
+
-o ltx2-i2v.mp4
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
最初と最後のフレームを指定する場合:
|
|
173
|
+
|
|
174
|
+
```bash
|
|
175
|
+
IMAGE_ID=$(curl -sS -X POST http://localhost:${PORT:-8000}/v1/files \
|
|
176
|
+
-F "file=@first_frame.png;type=image/png" | jq -r .file_id)
|
|
177
|
+
END_IMAGE_ID=$(curl -sS -X POST http://localhost:${PORT:-8000}/v1/files \
|
|
178
|
+
-F "file=@last_frame.png;type=image/png" | jq -r .file_id)
|
|
179
|
+
|
|
180
|
+
PARAMS=$(
|
|
181
|
+
jq -n \
|
|
182
|
+
--arg image "$IMAGE_ID" \
|
|
183
|
+
--arg end_image "$END_IMAGE_ID" \
|
|
184
|
+
--arg prompt "a smooth transition from morning to sunset" \
|
|
185
|
+
'{
|
|
186
|
+
mode: "sync",
|
|
187
|
+
prompt: $prompt,
|
|
188
|
+
image: {type: "file_id", file_id: $image},
|
|
189
|
+
end_image: {type: "file_id", file_id: $end_image},
|
|
190
|
+
num_frames: 97,
|
|
191
|
+
image_strength: 0.8,
|
|
192
|
+
end_image_strength: 0.8,
|
|
193
|
+
seed: 4
|
|
194
|
+
}'
|
|
195
|
+
)
|
|
196
|
+
|
|
197
|
+
curl -sS -X POST http://localhost:${PORT:-8000}/v1/video/ltx2/generate \
|
|
198
|
+
-H 'Content-Type: application/json' \
|
|
199
|
+
--data-binary "$PARAMS" \
|
|
200
|
+
-o ltx2-first-last.mp4
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
### generate — A2V
|
|
204
|
+
|
|
205
|
+
音声ファイルを Files API にアップロードして参照すると、音声がモーションやタイミングを駆動し、
|
|
206
|
+
出力 MP4 にミックスされます。
|
|
207
|
+
|
|
208
|
+
```bash
|
|
209
|
+
AUDIO_ID=$(curl -sS -X POST http://localhost:${PORT:-8000}/v1/files \
|
|
210
|
+
-F "file=@drums.wav;type=audio/wav" | jq -r .file_id)
|
|
211
|
+
|
|
212
|
+
PARAMS=$(
|
|
213
|
+
jq -n \
|
|
214
|
+
--arg audio "$AUDIO_ID" \
|
|
215
|
+
--arg prompt "a drummer on stage, energetic performance, stage lighting" \
|
|
216
|
+
'{
|
|
217
|
+
mode: "sync",
|
|
218
|
+
prompt: $prompt,
|
|
219
|
+
audio: {type: "file_id", file_id: $audio},
|
|
220
|
+
width: 512,
|
|
221
|
+
height: 512,
|
|
222
|
+
num_frames: 97,
|
|
223
|
+
seed: 5
|
|
224
|
+
}'
|
|
225
|
+
)
|
|
226
|
+
|
|
227
|
+
curl -sS -X POST http://localhost:${PORT:-8000}/v1/video/ltx2/generate \
|
|
228
|
+
-H 'Content-Type: application/json' \
|
|
229
|
+
--data-binary "$PARAMS" \
|
|
230
|
+
-o ltx2-a2v.mp4
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
### generate — T2V + Audio
|
|
234
|
+
|
|
235
|
+
音声ファイルを使わず、動画と一緒に音声を生成します。
|
|
236
|
+
|
|
237
|
+
```bash
|
|
238
|
+
PARAMS=$(
|
|
239
|
+
jq -n \
|
|
240
|
+
--arg prompt "a tiny robot dancing in a neon room, playful electronic beat" \
|
|
241
|
+
'{
|
|
242
|
+
mode: "sync",
|
|
243
|
+
prompt: $prompt,
|
|
244
|
+
width: 512,
|
|
245
|
+
height: 512,
|
|
246
|
+
num_frames: 97,
|
|
247
|
+
generate_audio: true,
|
|
248
|
+
seed: 6
|
|
249
|
+
}'
|
|
250
|
+
)
|
|
251
|
+
|
|
252
|
+
curl -sS -X POST http://localhost:${PORT:-8000}/v1/video/ltx2/generate \
|
|
253
|
+
-H 'Content-Type: application/json' \
|
|
254
|
+
--data-binary "$PARAMS" \
|
|
255
|
+
-o ltx2-audio.mp4
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
### async
|
|
259
|
+
|
|
260
|
+
```bash
|
|
261
|
+
PARAMS=$(
|
|
262
|
+
jq -n \
|
|
263
|
+
--arg prompt "a cinematic shot of clouds moving over a mountain lake" \
|
|
264
|
+
'{
|
|
265
|
+
mode: "async",
|
|
266
|
+
prompt: $prompt,
|
|
267
|
+
width: 512,
|
|
268
|
+
height: 512,
|
|
269
|
+
num_frames: 97,
|
|
270
|
+
seed: 7
|
|
271
|
+
}'
|
|
272
|
+
)
|
|
273
|
+
|
|
274
|
+
JOB=$(curl -sS -X POST http://localhost:${PORT:-8000}/v1/video/ltx2/generate \
|
|
275
|
+
-H 'Accept: application/json' \
|
|
276
|
+
-H 'Content-Type: application/json' \
|
|
277
|
+
--data-binary "$PARAMS" | jq -r .job_id)
|
|
278
|
+
|
|
279
|
+
curl -sS http://localhost:${PORT:-8000}/v1/jobs/$JOB | jq .
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
完了後、Job の `artifacts[0]` または `result.file_id` を使って MP4 を取得します。
|
|
283
|
+
|
|
284
|
+
```bash
|
|
285
|
+
FID=$(curl -sS http://localhost:${PORT:-8000}/v1/jobs/$JOB | jq -r .result.file_id)
|
|
286
|
+
curl -sS http://localhost:${PORT:-8000}/v1/files/$FID/download -o ltx2-async.mp4
|
|
287
|
+
```
|