model-compose 0.4.8__tar.gz → 0.4.10__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.
- {model_compose-0.4.8/src/model_compose.egg-info → model_compose-0.4.10}/PKG-INFO +22 -30
- {model_compose-0.4.8 → model_compose-0.4.10}/README.md +21 -29
- {model_compose-0.4.8 → model_compose-0.4.10}/pyproject.toml +1 -1
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/cli/compose.py +27 -21
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/component/context.py +2 -1
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/component/services/__init__.py +1 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/component/services/datasets/datasets.py +25 -0
- model_compose-0.4.10/src/mindor/core/component/services/datasets/utils.py +12 -0
- model_compose-0.4.10/src/mindor/core/component/services/image_processor.py +210 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/component/services/model/base/huggingface.py +96 -20
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/component/services/model/tasks/chat_completion/huggingface.py +12 -2
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/component/services/model/tasks/face_embedding/common.py +1 -1
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/component/services/model/tasks/face_embedding/insightface.py +42 -24
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/component/services/model/tasks/image_to_text/huggingface.py +2 -2
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/component/services/model/tasks/text_generation/huggingface.py +7 -4
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/component/services/text_splitter.py +0 -1
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/controller/base.py +14 -1
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/controller/services/http_server.py +20 -4
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/listener/services/__init__.py +1 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/listener/services/http_callback.py +10 -12
- model_compose-0.4.10/src/mindor/core/listener/services/http_trigger.py +129 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/utils/renderers.py +9 -3
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/action/action.py +1 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/action/impl/__init__.py +1 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/action/impl/datasets/common.py +1 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/action/impl/datasets/datasets.py +9 -1
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/action/impl/datasets/providers/common.py +2 -2
- model_compose-0.4.10/src/mindor/dsl/schema/action/impl/image_processor.py +91 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/action/impl/model/impl/chat_completion.py +14 -1
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/action/impl/model/impl/common.py +1 -1
- model_compose-0.4.10/src/mindor/dsl/schema/action/impl/model_trainer/impl/common.py +85 -0
- model_compose-0.4.10/src/mindor/dsl/schema/action/impl/model_trainer/impl/sft.py +25 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/action/impl/text_splitter.py +0 -1
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/component/component.py +2 -1
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/component/impl/__init__.py +1 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/component/impl/common.py +10 -3
- model_compose-0.4.10/src/mindor/dsl/schema/component/impl/image_processor.py +17 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/component/impl/model/impl/common.py +41 -0
- model_compose-0.4.10/src/mindor/dsl/schema/component/impl/model_trainer/impl/common.py +27 -0
- model_compose-0.4.10/src/mindor/dsl/schema/component/impl/types.py +15 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/controller/impl/common.py +1 -1
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/listener/impl/__init__.py +1 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/listener/impl/http_callback.py +1 -1
- model_compose-0.4.10/src/mindor/dsl/schema/listener/impl/http_trigger.py +27 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/listener/impl/types.py +1 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/listener/listener.py +2 -1
- model_compose-0.4.10/src/mindor/dsl/utils/path.py +23 -0
- {model_compose-0.4.8 → model_compose-0.4.10/src/model_compose.egg-info}/PKG-INFO +22 -30
- {model_compose-0.4.8 → model_compose-0.4.10}/src/model_compose.egg-info/SOURCES.txt +7 -0
- model_compose-0.4.8/src/mindor/dsl/schema/action/impl/model_trainer/impl/common.py +0 -22
- model_compose-0.4.8/src/mindor/dsl/schema/action/impl/model_trainer/impl/sft.py +0 -7
- model_compose-0.4.8/src/mindor/dsl/schema/component/impl/model_trainer/impl/common.py +0 -18
- model_compose-0.4.8/src/mindor/dsl/schema/component/impl/types.py +0 -14
- {model_compose-0.4.8 → model_compose-0.4.10}/LICENSE +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/setup.cfg +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/__init__.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/cli/__init__.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/__init__.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/component/__init__.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/component/base.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/component/component.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/component/services/datasets/__init__.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/component/services/datasets/providers/__init__.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/component/services/datasets/providers/common.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/component/services/datasets/providers/huggingface.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/component/services/datasets/providers/local.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/component/services/http_client.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/component/services/http_server.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/component/services/mcp_client.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/component/services/mcp_server.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/component/services/model/__init__.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/component/services/model/base/__init__.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/component/services/model/base/common.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/component/services/model/base/huggingface_hub.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/component/services/model/base/unsloth.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/component/services/model/model.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/component/services/model/tasks/__init__.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/component/services/model/tasks/chat_completion/__init__.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/component/services/model/tasks/face_embedding/__init__.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/component/services/model/tasks/face_embedding/custom.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/component/services/model/tasks/image_generation/__init__.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/component/services/model/tasks/image_generation/common.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/component/services/model/tasks/image_generation/custom.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/component/services/model/tasks/image_generation/flux.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/component/services/model/tasks/image_generation/hunyuan_image.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/component/services/model/tasks/image_generation/sdxl.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/component/services/model/tasks/image_to_text/__init__.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/component/services/model/tasks/image_upscale/__init__.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/component/services/model/tasks/image_upscale/common.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/component/services/model/tasks/image_upscale/custom.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/component/services/model/tasks/image_upscale/esrgan.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/component/services/model/tasks/image_upscale/ldsr.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/component/services/model/tasks/image_upscale/real_esrgan.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/component/services/model/tasks/image_upscale/swinir.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/component/services/model/tasks/text_classification/__init__.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/component/services/model/tasks/text_classification/huggingface.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/component/services/model/tasks/text_embedding/__init__.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/component/services/model/tasks/text_embedding/huggingface.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/component/services/model/tasks/text_generation/__init__.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/component/services/shell.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/component/services/vector_store/__init__.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/component/services/vector_store/base.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/component/services/vector_store/drivers/__init__.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/component/services/vector_store/drivers/chroma.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/component/services/vector_store/drivers/milvus.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/component/services/vector_store/vector_store.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/component/services/workflow.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/compose/__init__.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/compose/compose.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/compose/manager.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/controller/__init__.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/controller/controller.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/controller/runner/__init__.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/controller/runner/client.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/controller/runner/http_client.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/controller/runner/mcp_client.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/controller/runner/runner.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/controller/runtime/__init__.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/controller/runtime/docker/__init__.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/controller/runtime/docker/context/Dockerfile +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/controller/runtime/docker/docker.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/controller/runtime/native/__init__.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/controller/runtime/native/native.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/controller/runtime/specs.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/controller/services/__init__.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/controller/services/mcp_server.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/controller/webui/__init__.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/controller/webui/gradio.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/controller/webui/webui.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/foundation/__init__.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/foundation/async_service.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/gateway/__init__.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/gateway/base.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/gateway/gateway.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/gateway/services/__init__.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/gateway/services/http_tunnel/__init__.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/gateway/services/http_tunnel/base.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/gateway/services/http_tunnel/drivers/__init__.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/gateway/services/http_tunnel/drivers/cloudflare.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/gateway/services/http_tunnel/drivers/ngrok.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/gateway/services/http_tunnel/http_tunnel.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/gateway/services/ssh_tunnel.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/listener/__init__.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/listener/base.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/listener/listener.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/logger/__init__.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/logger/base.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/logger/logger.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/logger/logging.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/logger/services/__init__.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/logger/services/console.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/logger/services/file.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/runtime/__init__.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/runtime/docker/__init__.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/runtime/docker/docker.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/runtime/env.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/utils/__init__.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/utils/caching.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/utils/http_client.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/utils/http_request.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/utils/http_response.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/utils/http_status.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/utils/image.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/utils/mcp_client.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/utils/package.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/utils/resolvers.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/utils/shell.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/utils/ssh_client.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/utils/streamer.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/utils/streaming.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/utils/time.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/utils/websocket_client.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/utils/work_queue.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/workflow/__init__.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/workflow/context.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/workflow/job/__init__.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/workflow/job/base.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/workflow/job/impl/__init__.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/workflow/job/impl/action.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/workflow/job/impl/delay.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/workflow/job/impl/filter.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/workflow/job/impl/if_.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/workflow/job/impl/random_router.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/workflow/job/impl/switch.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/workflow/job/job.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/workflow/schema.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/workflow/workflow.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/__init__.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/loader.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/__init__.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/action/__init__.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/action/impl/common.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/action/impl/datasets/__init__.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/action/impl/datasets/providers/__init__.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/action/impl/datasets/providers/huggingface.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/action/impl/datasets/providers/local.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/action/impl/http_client.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/action/impl/http_server.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/action/impl/mcp_client.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/action/impl/mcp_server.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/action/impl/model/__init__.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/action/impl/model/impl/__init__.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/action/impl/model/impl/face_embedding/__init__.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/action/impl/model/impl/face_embedding/face_embedding.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/action/impl/model/impl/face_embedding/impl/__init__.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/action/impl/model/impl/face_embedding/impl/common.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/action/impl/model/impl/face_embedding/impl/dlib.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/action/impl/model/impl/face_embedding/impl/facenet.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/action/impl/model/impl/face_embedding/impl/insightface.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/action/impl/model/impl/image_generation/__init__.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/action/impl/model/impl/image_generation/image_generation.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/action/impl/model/impl/image_generation/impl/__init__.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/action/impl/model/impl/image_generation/impl/common.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/action/impl/model/impl/image_generation/impl/flux.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/action/impl/model/impl/image_generation/impl/hunyuan_image.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/action/impl/model/impl/image_generation/impl/sdxl.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/action/impl/model/impl/image_to_text.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/action/impl/model/impl/image_upscale/__init__.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/action/impl/model/impl/image_upscale/image_upscale.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/action/impl/model/impl/image_upscale/impl/__init__.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/action/impl/model/impl/image_upscale/impl/common.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/action/impl/model/impl/image_upscale/impl/esrgan.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/action/impl/model/impl/image_upscale/impl/ldsr.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/action/impl/model/impl/image_upscale/impl/real_esrgan.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/action/impl/model/impl/image_upscale/impl/swinir.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/action/impl/model/impl/text_classification.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/action/impl/model/impl/text_embedding.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/action/impl/model/impl/text_generation.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/action/impl/model/model.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/action/impl/model_trainer/__init__.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/action/impl/model_trainer/impl/__init__.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/action/impl/model_trainer/impl/classification.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/action/impl/model_trainer/model_trainer.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/action/impl/shell.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/action/impl/vector_store/__init__.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/action/impl/vector_store/impl/__init__.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/action/impl/vector_store/impl/chroma.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/action/impl/vector_store/impl/common.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/action/impl/vector_store/impl/faiss.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/action/impl/vector_store/impl/milvus.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/action/impl/vector_store/impl/qdrant.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/action/impl/vector_store/vector_store.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/action/impl/workflow.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/component/__init__.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/component/impl/datasets/__init__.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/component/impl/datasets/datasets.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/component/impl/http_client.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/component/impl/http_server.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/component/impl/mcp_client.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/component/impl/mcp_server.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/component/impl/model/__init__.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/component/impl/model/impl/__init__.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/component/impl/model/impl/chat_completion.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/component/impl/model/impl/face_embedding/__init__.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/component/impl/model/impl/face_embedding/face_embedding.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/component/impl/model/impl/face_embedding/impl/__init__.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/component/impl/model/impl/face_embedding/impl/common.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/component/impl/model/impl/face_embedding/impl/dlib.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/component/impl/model/impl/face_embedding/impl/facenet.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/component/impl/model/impl/face_embedding/impl/insightface.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/component/impl/model/impl/image_generation/__init__.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/component/impl/model/impl/image_generation/image_generation.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/component/impl/model/impl/image_generation/impl/__init__.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/component/impl/model/impl/image_generation/impl/common.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/component/impl/model/impl/image_generation/impl/flux.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/component/impl/model/impl/image_generation/impl/hunyuan_image.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/component/impl/model/impl/image_generation/impl/sdxl.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/component/impl/model/impl/image_to_text.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/component/impl/model/impl/image_upscale/__init__.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/component/impl/model/impl/image_upscale/image_upscale.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/component/impl/model/impl/image_upscale/impl/__init__.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/component/impl/model/impl/image_upscale/impl/common.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/component/impl/model/impl/image_upscale/impl/esrgan.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/component/impl/model/impl/image_upscale/impl/ldsr.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/component/impl/model/impl/image_upscale/impl/real_esrgan.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/component/impl/model/impl/image_upscale/impl/swinir.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/component/impl/model/impl/text_classification.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/component/impl/model/impl/text_embedding.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/component/impl/model/impl/text_generation.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/component/impl/model/model.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/component/impl/model_trainer/__init__.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/component/impl/model_trainer/impl/__init__.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/component/impl/model_trainer/impl/classification.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/component/impl/model_trainer/impl/sft.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/component/impl/model_trainer/model_trainer.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/component/impl/shell.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/component/impl/text_splitter.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/component/impl/vector_store/__init__.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/component/impl/vector_store/impl/__init__.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/component/impl/vector_store/impl/chroma.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/component/impl/vector_store/impl/common.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/component/impl/vector_store/impl/faiss.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/component/impl/vector_store/impl/milvus.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/component/impl/vector_store/impl/qdrant.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/component/impl/vector_store/vector_store.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/component/impl/workflow.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/compose.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/controller/__init__.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/controller/controller.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/controller/impl/__init__.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/controller/impl/http_server.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/controller/impl/mcp_server.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/controller/impl/types.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/controller/webui/__init__.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/controller/webui/impl/__init__.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/controller/webui/impl/common.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/controller/webui/impl/dynamic.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/controller/webui/impl/gradio.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/controller/webui/impl/static.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/controller/webui/webui.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/gateway/__init__.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/gateway/gateway.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/gateway/impl/__init__.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/gateway/impl/common.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/gateway/impl/http_tunnel/__init__.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/gateway/impl/http_tunnel/http_tunnel.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/gateway/impl/http_tunnel/impl/__init__.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/gateway/impl/http_tunnel/impl/cloudflare.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/gateway/impl/http_tunnel/impl/common.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/gateway/impl/http_tunnel/impl/ngrok.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/gateway/impl/ssh_tunnel.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/gateway/impl/types.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/job/__init__.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/job/impl/__init__.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/job/impl/action.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/job/impl/common.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/job/impl/delay.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/job/impl/filter.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/job/impl/if_.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/job/impl/random_router.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/job/impl/switch.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/job/impl/types.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/job/job.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/listener/__init__.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/listener/impl/common.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/logger/__init__.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/logger/impl/__init__.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/logger/impl/common.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/logger/impl/console.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/logger/impl/file.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/logger/impl/types.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/logger/logger.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/runtime/__init__.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/runtime/impl/__init__.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/runtime/impl/common.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/runtime/impl/docker.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/runtime/impl/native.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/runtime/impl/types.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/runtime/runtime.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/transport/__init__.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/transport/http.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/transport/ssh.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/schema/workflow.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/utils/__init__.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/utils/annotation.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/dsl/utils/enum.py +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/model_compose.egg-info/dependency_links.txt +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/model_compose.egg-info/entry_points.txt +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/model_compose.egg-info/requires.txt +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/src/model_compose.egg-info/top_level.txt +0 -0
- {model_compose-0.4.8 → model_compose-0.4.10}/tests/test_cli.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: model-compose
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.10
|
|
4
4
|
Summary: model-compose: Declarative AI Model and Workflow Orchestrator
|
|
5
5
|
Author-email: Hanyeol Cho <hanyeol.cho@gmail.com>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -65,6 +65,26 @@ pip install -e .
|
|
|
65
65
|
|
|
66
66
|
---
|
|
67
67
|
|
|
68
|
+
## 📚 Documentation
|
|
69
|
+
|
|
70
|
+
**📖 [Complete User Guide](docs/user-guide/00-table-of-contents.md)**
|
|
71
|
+
|
|
72
|
+
Need help getting started or want to explore advanced features? Check out our comprehensive user guide:
|
|
73
|
+
|
|
74
|
+
- **🌍 English**: [User Guide](docs/user-guide/00-table-of-contents.md)
|
|
75
|
+
- **🇰🇷 한국어**: [사용자 가이드](docs/user-guide/ko/00-table-of-contents.md)
|
|
76
|
+
|
|
77
|
+
The guide covers everything from basic concepts to advanced workflows, including:
|
|
78
|
+
- Getting started with model-compose
|
|
79
|
+
- Component and workflow configuration
|
|
80
|
+
- Local AI models and training
|
|
81
|
+
- Streaming mode and variable binding
|
|
82
|
+
- System integration with listeners and gateways
|
|
83
|
+
- Deployment strategies
|
|
84
|
+
- Practical examples and troubleshooting
|
|
85
|
+
|
|
86
|
+
---
|
|
87
|
+
|
|
68
88
|
## 🚀 How to Run
|
|
69
89
|
|
|
70
90
|
**model-compose** provides a CLI interface to launch and manage your AI workflows — inspired by `docker-compose`.
|
|
@@ -194,35 +214,7 @@ This minimal example defines a simple workflow that calls the OpenAI ChatGPT API
|
|
|
194
214
|
|
|
195
215
|
You can easily expand this example by adding more components (e.g., text-to-speech, image generation) and connecting them through additional jobs.
|
|
196
216
|
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
```
|
|
200
|
-
listener:
|
|
201
|
-
type: http-callback
|
|
202
|
-
port: 8090
|
|
203
|
-
base_path: /callbacks
|
|
204
|
-
callbacks:
|
|
205
|
-
- path: /chat-ai
|
|
206
|
-
method: POST
|
|
207
|
-
item: ${body.data}
|
|
208
|
-
identify_by: ${item.task_id}
|
|
209
|
-
result: ${item.choices[0].message.content}
|
|
210
|
-
```
|
|
211
|
-
|
|
212
|
-
This listener sets up an HTTP callback endpoint at `http://localhost:8090/callbacks/chat-ai` to handle asynchronous responses from an external service that behaves like ChatGPT but supports delayed or push-based results. This is useful when integrating with services that notify results via webhook-style callbacks.
|
|
213
|
-
|
|
214
|
-
#### 🌐 Gateway Example
|
|
215
|
-
|
|
216
|
-
```
|
|
217
|
-
gateway:
|
|
218
|
-
type: http-tunnel
|
|
219
|
-
driver: ngrok
|
|
220
|
-
port: 8090
|
|
221
|
-
```
|
|
222
|
-
|
|
223
|
-
This gateway configuration exposes the local listener defined above to the public internet using an HTTP tunnel powered by ngrok. It forwards incoming traffic from a secure, public URL (e.g., `https://abc123.ngrok.io`) directly to your local callback endpoint at `http://localhost:8090`. This is essential when integrating with third-party services that need to push data back to your workflow via webhooks or asynchronous callbacks.
|
|
224
|
-
|
|
225
|
-
> 📁 For more example model-compose.yml configurations, check the [examples directory](examples) in the source code.
|
|
217
|
+
> 📁 For more example configurations including listeners, gateways, and advanced workflows, check the [examples directory](examples) or refer to the [User Guide](docs/user-guide/00-table-of-contents.md).
|
|
226
218
|
|
|
227
219
|
---
|
|
228
220
|
## 🖥 Web UI
|
|
@@ -41,6 +41,26 @@ pip install -e .
|
|
|
41
41
|
|
|
42
42
|
---
|
|
43
43
|
|
|
44
|
+
## 📚 Documentation
|
|
45
|
+
|
|
46
|
+
**📖 [Complete User Guide](docs/user-guide/00-table-of-contents.md)**
|
|
47
|
+
|
|
48
|
+
Need help getting started or want to explore advanced features? Check out our comprehensive user guide:
|
|
49
|
+
|
|
50
|
+
- **🌍 English**: [User Guide](docs/user-guide/00-table-of-contents.md)
|
|
51
|
+
- **🇰🇷 한국어**: [사용자 가이드](docs/user-guide/ko/00-table-of-contents.md)
|
|
52
|
+
|
|
53
|
+
The guide covers everything from basic concepts to advanced workflows, including:
|
|
54
|
+
- Getting started with model-compose
|
|
55
|
+
- Component and workflow configuration
|
|
56
|
+
- Local AI models and training
|
|
57
|
+
- Streaming mode and variable binding
|
|
58
|
+
- System integration with listeners and gateways
|
|
59
|
+
- Deployment strategies
|
|
60
|
+
- Practical examples and troubleshooting
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
44
64
|
## 🚀 How to Run
|
|
45
65
|
|
|
46
66
|
**model-compose** provides a CLI interface to launch and manage your AI workflows — inspired by `docker-compose`.
|
|
@@ -170,35 +190,7 @@ This minimal example defines a simple workflow that calls the OpenAI ChatGPT API
|
|
|
170
190
|
|
|
171
191
|
You can easily expand this example by adding more components (e.g., text-to-speech, image generation) and connecting them through additional jobs.
|
|
172
192
|
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
```
|
|
176
|
-
listener:
|
|
177
|
-
type: http-callback
|
|
178
|
-
port: 8090
|
|
179
|
-
base_path: /callbacks
|
|
180
|
-
callbacks:
|
|
181
|
-
- path: /chat-ai
|
|
182
|
-
method: POST
|
|
183
|
-
item: ${body.data}
|
|
184
|
-
identify_by: ${item.task_id}
|
|
185
|
-
result: ${item.choices[0].message.content}
|
|
186
|
-
```
|
|
187
|
-
|
|
188
|
-
This listener sets up an HTTP callback endpoint at `http://localhost:8090/callbacks/chat-ai` to handle asynchronous responses from an external service that behaves like ChatGPT but supports delayed or push-based results. This is useful when integrating with services that notify results via webhook-style callbacks.
|
|
189
|
-
|
|
190
|
-
#### 🌐 Gateway Example
|
|
191
|
-
|
|
192
|
-
```
|
|
193
|
-
gateway:
|
|
194
|
-
type: http-tunnel
|
|
195
|
-
driver: ngrok
|
|
196
|
-
port: 8090
|
|
197
|
-
```
|
|
198
|
-
|
|
199
|
-
This gateway configuration exposes the local listener defined above to the public internet using an HTTP tunnel powered by ngrok. It forwards incoming traffic from a secure, public URL (e.g., `https://abc123.ngrok.io`) directly to your local callback endpoint at `http://localhost:8090`. This is essential when integrating with third-party services that need to push data back to your workflow via webhooks or asynchronous callbacks.
|
|
200
|
-
|
|
201
|
-
> 📁 For more example model-compose.yml configurations, check the [examples directory](examples) in the source code.
|
|
193
|
+
> 📁 For more example configurations including listeners, gateways, and advanced workflows, check the [examples directory](examples) or refer to the [User Guide](docs/user-guide/00-table-of-contents.md).
|
|
202
194
|
|
|
203
195
|
---
|
|
204
196
|
## 🖥 Web UI
|
|
@@ -1,11 +1,18 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
from typing import Optional, List
|
|
2
|
+
import importlib.metadata
|
|
3
3
|
from pathlib import Path
|
|
4
|
+
import click
|
|
4
5
|
import asyncio
|
|
6
|
+
import json
|
|
5
7
|
|
|
6
|
-
|
|
7
|
-
from mindor.
|
|
8
|
-
from mindor.core.
|
|
8
|
+
def _load_compose_config(config_files: List[Path], env_files: List[Path], env_data: List[str]):
|
|
9
|
+
from mindor.dsl.loader import load_compose_config
|
|
10
|
+
from mindor.core.runtime.env import load_env_files, merge_env_data
|
|
11
|
+
|
|
12
|
+
env = load_env_files(".", env_files or [])
|
|
13
|
+
env = merge_env_data(env, env_data)
|
|
14
|
+
|
|
15
|
+
return load_compose_config(".", config_files, env)
|
|
9
16
|
|
|
10
17
|
@click.group()
|
|
11
18
|
@click.option(
|
|
@@ -13,6 +20,10 @@ from mindor.core.compose import *
|
|
|
13
20
|
type=click.Path(exists=True, dir_okay=False, path_type=Path),
|
|
14
21
|
help="Compose configuration files."
|
|
15
22
|
)
|
|
23
|
+
@click.version_option(
|
|
24
|
+
version=importlib.metadata.version("model-compose"),
|
|
25
|
+
message="%(prog)s %(version)s"
|
|
26
|
+
)
|
|
16
27
|
@click.pass_context
|
|
17
28
|
def compose_command(ctx: click.Context, config_files: List[Path]) -> None:
|
|
18
29
|
"""model-compose"""
|
|
@@ -34,18 +45,17 @@ def compose_command(ctx: click.Context, config_files: List[Path]) -> None:
|
|
|
34
45
|
@click.option("--verbose", "-v", is_flag=True, help="Enable verbose output.")
|
|
35
46
|
@click.pass_context
|
|
36
47
|
def up_command(
|
|
37
|
-
ctx: click.Context,
|
|
48
|
+
ctx: click.Context,
|
|
38
49
|
detach: bool,
|
|
39
50
|
env_files: List[Path],
|
|
40
51
|
env_data: List[str],
|
|
41
52
|
verbose: bool
|
|
42
53
|
) -> None:
|
|
54
|
+
from mindor.core.compose import launch_services
|
|
43
55
|
config_files = ctx.obj.get("config_files", [])
|
|
44
56
|
async def _async_command():
|
|
45
57
|
try:
|
|
46
|
-
|
|
47
|
-
env = merge_env_data(env, env_data)
|
|
48
|
-
config = load_compose_config(".", config_files, env)
|
|
58
|
+
config = _load_compose_config(config_files, env_files, env_data)
|
|
49
59
|
await launch_services(config, detach, verbose)
|
|
50
60
|
except Exception as e:
|
|
51
61
|
click.echo(f"❌ {e}", err=True)
|
|
@@ -70,12 +80,11 @@ def down_command(
|
|
|
70
80
|
env_data: List[str],
|
|
71
81
|
verbose: bool
|
|
72
82
|
) -> None:
|
|
83
|
+
from mindor.core.compose import terminate_services
|
|
73
84
|
config_files = ctx.obj.get("config_files", [])
|
|
74
85
|
async def _async_command():
|
|
75
86
|
try:
|
|
76
|
-
|
|
77
|
-
env = merge_env_data(env, env_data)
|
|
78
|
-
config = load_compose_config(".", config_files, env)
|
|
87
|
+
config = _load_compose_config(config_files, env_files, env_data)
|
|
79
88
|
await terminate_services(config, verbose)
|
|
80
89
|
except Exception as e:
|
|
81
90
|
click.echo(f"❌ {e}", err=True)
|
|
@@ -100,12 +109,11 @@ def start_command(
|
|
|
100
109
|
env_data: List[str],
|
|
101
110
|
verbose: bool
|
|
102
111
|
) -> None:
|
|
112
|
+
from mindor.core.compose import start_services
|
|
103
113
|
config_files = ctx.obj.get("config_files", [])
|
|
104
114
|
async def _async_command():
|
|
105
115
|
try:
|
|
106
|
-
|
|
107
|
-
env = merge_env_data(env, env_data)
|
|
108
|
-
config = load_compose_config(".", config_files, env)
|
|
116
|
+
config = _load_compose_config(config_files, env_files, env_data)
|
|
109
117
|
await start_services(config, verbose)
|
|
110
118
|
except Exception as e:
|
|
111
119
|
click.echo(f"❌ {e}", err=True)
|
|
@@ -130,12 +138,11 @@ def stop_command(
|
|
|
130
138
|
env_data: List[str],
|
|
131
139
|
verbose: bool
|
|
132
140
|
) -> None:
|
|
141
|
+
from mindor.core.compose import stop_services
|
|
133
142
|
config_files = ctx.obj.get("config_files", [])
|
|
134
143
|
async def _async_command():
|
|
135
144
|
try:
|
|
136
|
-
|
|
137
|
-
env = merge_env_data(env, env_data)
|
|
138
|
-
config = load_compose_config(".", config_files, env)
|
|
145
|
+
config = _load_compose_config(config_files, env_files, env_data)
|
|
139
146
|
await stop_services(config, verbose)
|
|
140
147
|
except Exception as e:
|
|
141
148
|
click.echo(f"❌ {e}", err=True)
|
|
@@ -176,12 +183,11 @@ def run_command(
|
|
|
176
183
|
output_path: Optional[Path],
|
|
177
184
|
verbose: bool
|
|
178
185
|
) -> None:
|
|
186
|
+
from mindor.core.compose import run_workflow
|
|
179
187
|
config_files = ctx.obj.get("config_files", [])
|
|
180
188
|
async def _async_command():
|
|
181
189
|
try:
|
|
182
|
-
|
|
183
|
-
env = merge_env_data(env, env_data)
|
|
184
|
-
config = load_compose_config(".", config_files, env)
|
|
190
|
+
config = _load_compose_config(config_files, env_files, env_data)
|
|
185
191
|
input = json.loads(input_json) if input_json else {}
|
|
186
192
|
state = await run_workflow(config, workflow_id or "__default__", input, output_path, verbose)
|
|
187
193
|
if isinstance(state.output, (dict, list)) or state.error:
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
from typing import Type, Union, Literal, Optional, Dict, List, Tuple, Set, Annotated, Any
|
|
2
2
|
from mindor.core.utils.renderers import VariableRenderer, ImageValueRenderer
|
|
3
3
|
from mindor.core.gateway import find_gateway_by_port
|
|
4
|
+
from PIL import Image as PILImage
|
|
4
5
|
|
|
5
6
|
class ComponentActionContext:
|
|
6
7
|
def __init__(self, run_id: str, input: Dict[str, Any]):
|
|
@@ -16,7 +17,7 @@ class ComponentActionContext:
|
|
|
16
17
|
async def render_variable(self, value: Any, ignore_files: bool = False) -> Any:
|
|
17
18
|
return await self.renderer.render(value, ignore_files)
|
|
18
19
|
|
|
19
|
-
async def render_image(self, value: Any) ->
|
|
20
|
+
async def render_image(self, value: Any) -> Optional[PILImage.Image]:
|
|
20
21
|
return await ImageValueRenderer().render(await self.render_variable(value))
|
|
21
22
|
|
|
22
23
|
def contains_variable_reference(self, key: str, value: Any) -> bool:
|
{model_compose-0.4.8 → model_compose-0.4.10}/src/mindor/core/component/services/datasets/datasets.py
RENAMED
|
@@ -6,6 +6,7 @@ from mindor.dsl.schema.action import DatasetsActionConfig, DatasetsActionMethod,
|
|
|
6
6
|
from ...base import ComponentService, ComponentType, ComponentGlobalConfigs, register_component
|
|
7
7
|
from ...context import ComponentActionContext
|
|
8
8
|
from .providers import HuggingfaceDatasetsProvider, LocalDatasetsProvider
|
|
9
|
+
from .utils import format_template_example
|
|
9
10
|
|
|
10
11
|
if TYPE_CHECKING:
|
|
11
12
|
from datasets import Dataset
|
|
@@ -30,6 +31,9 @@ class DatasetsAction:
|
|
|
30
31
|
if self.config.method == DatasetsActionMethod.SELECT:
|
|
31
32
|
return await self._select(context)
|
|
32
33
|
|
|
34
|
+
if self.config.method == DatasetsActionMethod.MAP:
|
|
35
|
+
return await self._map(context)
|
|
36
|
+
|
|
33
37
|
raise ValueError(f"Unsupported datasets action method: {self.config.method}")
|
|
34
38
|
|
|
35
39
|
async def _load(self, context: ComponentActionContext) -> Dataset:
|
|
@@ -64,6 +68,10 @@ class DatasetsAction:
|
|
|
64
68
|
info = await context.render_variable(self.config.info)
|
|
65
69
|
split = await context.render_variable(self.config.split)
|
|
66
70
|
|
|
71
|
+
for dataset in datasets:
|
|
72
|
+
if not isinstance(dataset, Dataset):
|
|
73
|
+
raise ValueError(f"Expected Dataset instance, but got {type(dataset).__name__}")
|
|
74
|
+
|
|
67
75
|
return concatenate_datasets(
|
|
68
76
|
datasets,
|
|
69
77
|
info=info,
|
|
@@ -77,6 +85,9 @@ class DatasetsAction:
|
|
|
77
85
|
indices = await context.render_variable(self.config.indices)
|
|
78
86
|
columns = await context.render_variable(self.config.columns)
|
|
79
87
|
|
|
88
|
+
if not isinstance(dataset, Dataset):
|
|
89
|
+
raise ValueError(f"Expected Dataset instance, but got {type(dataset).__name__}")
|
|
90
|
+
|
|
80
91
|
if axis == "rows":
|
|
81
92
|
if indices is None:
|
|
82
93
|
raise ValueError("indices must be provided when axis='rows'")
|
|
@@ -89,6 +100,20 @@ class DatasetsAction:
|
|
|
89
100
|
|
|
90
101
|
raise ValueError(f"Unsupported axis: {axis}")
|
|
91
102
|
|
|
103
|
+
async def _map(self, context: ComponentActionContext) -> Dataset:
|
|
104
|
+
dataset = await context.render_variable(self.config.dataset)
|
|
105
|
+
template = await context.render_variable(self.config.template)
|
|
106
|
+
output_column = await context.render_variable(self.config.output_column)
|
|
107
|
+
remove_columns = await context.render_variable(self.config.remove_columns)
|
|
108
|
+
|
|
109
|
+
if not isinstance(dataset, Dataset):
|
|
110
|
+
raise ValueError(f"Expected Dataset instance, but got {type(dataset).__name__}")
|
|
111
|
+
|
|
112
|
+
def format_example(example):
|
|
113
|
+
return { output_column: format_template_example(template, example) }
|
|
114
|
+
|
|
115
|
+
return dataset.map(format_example, remove_columns=remove_columns)
|
|
116
|
+
|
|
92
117
|
@register_component(ComponentType.DATASETS)
|
|
93
118
|
class DatasetsComponent(ComponentService):
|
|
94
119
|
def __init__(self, id: str, config: DatasetsActionConfig, global_configs: ComponentGlobalConfigs, daemon: bool):
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
from typing import Dict, List, Any
|
|
2
|
+
import re
|
|
3
|
+
|
|
4
|
+
def format_template_example(template: str, example: Dict[str, Any]) -> str:
|
|
5
|
+
column_names = set(re.findall(r"\{(\w+)\}", template))
|
|
6
|
+
formatted = template
|
|
7
|
+
|
|
8
|
+
for column in column_names:
|
|
9
|
+
if column in example:
|
|
10
|
+
formatted = formatted.replace(f"{{{column}}}", str(example[column]))
|
|
11
|
+
|
|
12
|
+
return formatted
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
from typing import Type, Union, Literal, Optional, Dict, List, Tuple, Set, Annotated, Any
|
|
2
|
+
from mindor.dsl.schema.component import ImageProcessorComponentConfig
|
|
3
|
+
from mindor.dsl.schema.action import ActionConfig, ImageProcessorActionConfig, ImageProcessorActionMethod, ImageScaleMode, FlipDirection
|
|
4
|
+
from ..base import ComponentService, ComponentType, ComponentGlobalConfigs, register_component
|
|
5
|
+
from ..context import ComponentActionContext
|
|
6
|
+
from PIL import Image as PILImage, ImageFilter, ImageEnhance
|
|
7
|
+
|
|
8
|
+
class ImageProcessorAction:
|
|
9
|
+
def __init__(self, config: ImageProcessorActionConfig):
|
|
10
|
+
self.config: ImageProcessorActionConfig = config
|
|
11
|
+
|
|
12
|
+
async def run(self, context: ComponentActionContext) -> Any:
|
|
13
|
+
result = await self._dispatch(context)
|
|
14
|
+
context.register_source("result", result)
|
|
15
|
+
|
|
16
|
+
return (await context.render_variable(self.config.output, ignore_files=True)) if self.config.output else result
|
|
17
|
+
|
|
18
|
+
async def _dispatch(self, context: ComponentActionContext) -> Any:
|
|
19
|
+
if self.config.method == ImageProcessorActionMethod.RESIZE:
|
|
20
|
+
return await self._resize(context)
|
|
21
|
+
|
|
22
|
+
if self.config.method == ImageProcessorActionMethod.CROP:
|
|
23
|
+
return await self._crop(context)
|
|
24
|
+
|
|
25
|
+
if self.config.method == ImageProcessorActionMethod.ROTATE:
|
|
26
|
+
return await self._rotate(context)
|
|
27
|
+
|
|
28
|
+
if self.config.method == ImageProcessorActionMethod.FLIP:
|
|
29
|
+
return await self._flip(context)
|
|
30
|
+
|
|
31
|
+
if self.config.method == ImageProcessorActionMethod.GRAYSCALE:
|
|
32
|
+
return await self._grayscale(context)
|
|
33
|
+
|
|
34
|
+
if self.config.method == ImageProcessorActionMethod.BLUR:
|
|
35
|
+
return await self._blur(context)
|
|
36
|
+
|
|
37
|
+
if self.config.method == ImageProcessorActionMethod.SHARPEN:
|
|
38
|
+
return await self._sharpen(context)
|
|
39
|
+
|
|
40
|
+
if self.config.method == ImageProcessorActionMethod.ADJUST_BRIGHTNESS:
|
|
41
|
+
return await self._adjust_brightness(context)
|
|
42
|
+
|
|
43
|
+
if self.config.method == ImageProcessorActionMethod.ADJUST_CONTRAST:
|
|
44
|
+
return await self._adjust_contrast(context)
|
|
45
|
+
|
|
46
|
+
if self.config.method == ImageProcessorActionMethod.ADJUST_SATURATION:
|
|
47
|
+
return await self._adjust_saturation(context)
|
|
48
|
+
|
|
49
|
+
raise ValueError(f"Unsupported image processing action method: {self.config.method}")
|
|
50
|
+
|
|
51
|
+
async def _resize(self, context: ComponentActionContext) -> Optional[PILImage.Image]:
|
|
52
|
+
image = await context.render_image(self.config.image)
|
|
53
|
+
width = await context.render_variable(self.config.width) if self.config.width else None
|
|
54
|
+
height = await context.render_variable(self.config.height) if self.config.height else None
|
|
55
|
+
scale_mode = await context.render_variable(self.config.scale_mode)
|
|
56
|
+
|
|
57
|
+
if width is None and height is None:
|
|
58
|
+
raise ValueError("At least one of width or height must be specified for resize")
|
|
59
|
+
|
|
60
|
+
if image:
|
|
61
|
+
return self._resize_image(image, width, height, scale_mode)
|
|
62
|
+
|
|
63
|
+
return None
|
|
64
|
+
|
|
65
|
+
async def _crop(self, context: ComponentActionContext) -> Optional[PILImage.Image]:
|
|
66
|
+
image = await context.render_image(self.config.image)
|
|
67
|
+
x = await context.render_variable(self.config.x)
|
|
68
|
+
y = await context.render_variable(self.config.y)
|
|
69
|
+
width = await context.render_variable(self.config.width)
|
|
70
|
+
height = await context.render_variable(self.config.height)
|
|
71
|
+
|
|
72
|
+
if image:
|
|
73
|
+
return image.crop(x, y, x + width, y + height)
|
|
74
|
+
|
|
75
|
+
return None
|
|
76
|
+
|
|
77
|
+
async def _rotate(self, context: ComponentActionContext) -> Optional[PILImage.Image]:
|
|
78
|
+
image = await context.render_image(self.config.image)
|
|
79
|
+
angle = await context.render_variable(self.config.angle)
|
|
80
|
+
expand = await context.render_variable(self.config.expand)
|
|
81
|
+
|
|
82
|
+
if image:
|
|
83
|
+
return image.rotate(-angle, expand=expand, resample=PILImage.Resampling.BICUBIC)
|
|
84
|
+
|
|
85
|
+
return None
|
|
86
|
+
|
|
87
|
+
async def _flip(self, context: ComponentActionContext) -> Optional[PILImage.Image]:
|
|
88
|
+
image = await context.render_image(self.config.image)
|
|
89
|
+
direction = await context.render_variable(self.config.direction)
|
|
90
|
+
|
|
91
|
+
if image:
|
|
92
|
+
if direction == FlipDirection.HORIZONTAL:
|
|
93
|
+
return image.transpose(PILImage.Transpose.FLIP_LEFT_RIGHT)
|
|
94
|
+
|
|
95
|
+
if direction == FlipDirection.VERTICAL:
|
|
96
|
+
return image.transpose(PILImage.Transpose.FLIP_TOP_BOTTOM)
|
|
97
|
+
|
|
98
|
+
return None
|
|
99
|
+
|
|
100
|
+
async def _grayscale(self, context: ComponentActionContext) -> Optional[PILImage.Image]:
|
|
101
|
+
image = await context.render_image(self.config.image)
|
|
102
|
+
|
|
103
|
+
if image:
|
|
104
|
+
return image.convert("L")
|
|
105
|
+
|
|
106
|
+
return None
|
|
107
|
+
|
|
108
|
+
async def _blur(self, context: ComponentActionContext) -> Optional[PILImage.Image]:
|
|
109
|
+
image = await context.render_image(self.config.image)
|
|
110
|
+
radius = await context.render_variable(self.config.radius)
|
|
111
|
+
|
|
112
|
+
if image:
|
|
113
|
+
return image.filter(ImageFilter.GaussianBlur(radius=radius))
|
|
114
|
+
|
|
115
|
+
async def _sharpen(self, context: ComponentActionContext) -> Optional[PILImage.Image]:
|
|
116
|
+
image = await context.render_image(self.config.image)
|
|
117
|
+
factor = await context.render_variable(self.config.factor)
|
|
118
|
+
|
|
119
|
+
if image:
|
|
120
|
+
return ImageEnhance.Sharpness(image).enhance(factor)
|
|
121
|
+
|
|
122
|
+
return FileNotFoundError
|
|
123
|
+
|
|
124
|
+
async def _adjust_brightness(self, context: ComponentActionContext) -> Optional[PILImage.Image]:
|
|
125
|
+
image = await context.render_image(self.config.image)
|
|
126
|
+
factor = await context.render_variable(self.config.factor)
|
|
127
|
+
|
|
128
|
+
if image:
|
|
129
|
+
return ImageEnhance.Brightness(image).enhance(factor)
|
|
130
|
+
|
|
131
|
+
return None
|
|
132
|
+
|
|
133
|
+
async def _adjust_contrast(self, context: ComponentActionContext) -> Optional[PILImage.Image]:
|
|
134
|
+
image = await context.render_image(self.config.image)
|
|
135
|
+
factor = await context.render_variable(self.config.factor)
|
|
136
|
+
|
|
137
|
+
if image:
|
|
138
|
+
return ImageEnhance.Contrast(image).enhance(factor)
|
|
139
|
+
|
|
140
|
+
return image
|
|
141
|
+
|
|
142
|
+
async def _adjust_saturation(self, context: ComponentActionContext) -> Optional[PILImage.Image]:
|
|
143
|
+
image = await context.render_image(self.config.image)
|
|
144
|
+
factor = await context.render_variable(self.config.factor)
|
|
145
|
+
|
|
146
|
+
if image:
|
|
147
|
+
return ImageEnhance.Color(image).enhance(factor)
|
|
148
|
+
|
|
149
|
+
return None
|
|
150
|
+
|
|
151
|
+
def _resize_image(self, image: PILImage.Image, width: int, height: int, scale_mode: str) -> PILImage.Image:
|
|
152
|
+
original_width, original_height = image.size
|
|
153
|
+
target_width = width or original_width
|
|
154
|
+
target_height = height or original_height
|
|
155
|
+
|
|
156
|
+
if scale_mode == ImageScaleMode.FIT:
|
|
157
|
+
new_width, new_height = self._get_size_aspect_fit(target_width, target_height, original_width, original_height)
|
|
158
|
+
return image.resize((new_width, new_height), PILImage.Resampling.LANCZOS)
|
|
159
|
+
|
|
160
|
+
if scale_mode == ImageScaleMode.FILL:
|
|
161
|
+
new_width, new_height = self._get_size_aspect_fill(target_width, target_height, original_width, original_height)
|
|
162
|
+
image = image.resize((new_width, new_height), PILImage.Resampling.LANCZOS)
|
|
163
|
+
|
|
164
|
+
crop_box = self._get_center_crop_box(new_width, new_height, target_width, target_height)
|
|
165
|
+
return image.crop(crop_box)
|
|
166
|
+
|
|
167
|
+
if scale_mode == ImageScaleMode.STRETCH:
|
|
168
|
+
return image.resize((target_width, target_height), PILImage.Resampling.LANCZOS)
|
|
169
|
+
|
|
170
|
+
raise ValueError(f"Invalid scale_mode: {scale_mode}")
|
|
171
|
+
|
|
172
|
+
def _get_size_aspect_fit(self, target_width: int, target_height: int, original_width: int, original_height: int) -> Tuple[int, int]:
|
|
173
|
+
aspect_ratio = original_width / original_height
|
|
174
|
+
|
|
175
|
+
height = target_height
|
|
176
|
+
width = height * aspect_ratio
|
|
177
|
+
|
|
178
|
+
if width > target_width:
|
|
179
|
+
width = target_width
|
|
180
|
+
height = width / aspect_ratio
|
|
181
|
+
|
|
182
|
+
return (int(width), int(height))
|
|
183
|
+
|
|
184
|
+
def _get_size_aspect_fill(self, target_width: int, target_height: int, original_width: int, original_height: int) -> Tuple[int, int]:
|
|
185
|
+
aspect_ratio = original_width / original_height
|
|
186
|
+
|
|
187
|
+
height = target_height
|
|
188
|
+
width = height * aspect_ratio
|
|
189
|
+
|
|
190
|
+
if width < target_width:
|
|
191
|
+
width = target_width
|
|
192
|
+
height = width / aspect_ratio
|
|
193
|
+
|
|
194
|
+
return (int(width), int(height))
|
|
195
|
+
|
|
196
|
+
def _get_center_crop_box(self, image_width: int, image_height: int, target_width: int, target_height: int) -> Tuple[int, int, int, int]:
|
|
197
|
+
left = (image_width - target_width ) // 2
|
|
198
|
+
top = (image_height - target_height) // 2
|
|
199
|
+
right = left + target_width
|
|
200
|
+
bottom = top + target_height
|
|
201
|
+
|
|
202
|
+
return (left, top, right, bottom)
|
|
203
|
+
|
|
204
|
+
@register_component(ComponentType.IMAGE_PROCESSOR)
|
|
205
|
+
class ImageProcessorComponent(ComponentService):
|
|
206
|
+
def __init__(self, id: str, config: ImageProcessorComponentConfig, global_configs: ComponentGlobalConfigs, daemon: bool):
|
|
207
|
+
super().__init__(id, config, global_configs, daemon)
|
|
208
|
+
|
|
209
|
+
async def _run(self, action: ActionConfig, context: ComponentActionContext) -> Any:
|
|
210
|
+
return await ImageProcessorAction(action).run(context)
|