imajin/orchestrators/imajin-pipeline/pyproject.toml
2026-04-12 10:44:39 -07:00

109 lines
3.5 KiB
TOML

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "imajin-pipeline"
version = "1.0.0"
description = "Imajin pipeline orchestrator - 7-stage image generation"
requires-python = ">=3.12"
license = "MIT"
authors = [{ name = "Lilith", email = "quinn@ftw.codes" }]
keywords = ["imajin", "pipeline", "orchestration", "image-generation"]
dependencies = [
# Pipeline framework
"lilith-pipeline-framework>=1.0.0",
# HTTP clients for services and LLM calls
"httpx>=0.27.0",
# API
"fastapi>=0.115.0",
"uvicorn[standard]>=0.32.0",
"pydantic>=2.10.0",
"pydantic-settings>=2.6.0",
# Job storage
"redis>=5.0.0",
# Image handling (for validation/output stages only)
"Pillow>=10.0.0",
"numpy>=1.24.0",
# Configuration
"PyYAML>=6.0",
"lilith-service-addresses>=1.0.0",
]
# NOTE: GPU dependencies (diffusers, torch, etc.) are optional.
# Most stages call services via HTTP (moderation, text overlay, watermark).
# GenerateStage does GPU work directly when GPU is available (ControlNet, SDXL, SD3.5).
# Install GPU dependencies: pip install -e ".[controlnet]"
[project.optional-dependencies]
quality = ["opencv-python>=4.8.0"]
moderation = [
# Typed client for imajin-moderator service (optional, falls back to httpx)
# Install from local path: pip install -e ../../services/imajin-moderator/client
"imajin-moderator-client>=0.1.0",
]
anatomy_fix = [
"mediapipe>=0.10.0,<0.10.31", # Pin <0.10.31: controlnet-aux requires mp.solutions
"opencv-python>=4.8.0",
]
watermark_removal = [
"paddleocr>=2.7.0",
"paddlepaddle-gpu>=2.5.0",
"opencv-python>=4.8.0", # Required by PaddleOCR
]
controlnet = [
"controlnet-aux>=0.0.7", # OpenPose, Segmentation preprocessors
"diffusers>=0.27.0", # ControlNet pipeline support
"transformers>=4.30.0", # Required by diffusers
"accelerate>=0.20.0", # Required by diffusers
"torch>=2.0.0", # PyTorch for GPU operations
"opencv-python>=4.8.0", # Image preprocessing
]
flux = [
"diffusers>=0.30.0", # FLUX pipeline support (FluxPipeline)
"transformers>=4.40.0", # FLUX text encoders (T5-v1.1-xxl, CLIP)
"accelerate>=0.25.0", # Model sharding for large models
"torch>=2.1.0", # bfloat16 support for FLUX
"safetensors>=0.4.0", # Fast model loading
"sentencepiece>=0.2.0", # T5 tokenizer
]
pulid = [
"insightface>=0.7.3", # Face embedding extraction
"onnxruntime-gpu>=1.15.0", # InsightFace GPU backend
"model-boss-loaders[pulid]>=1.0.0", # PuLID loader
]
background_removal = [
"rembg>=2.0.50", # U2Net-based background removal
]
all = ["imajin-pipeline[quality,moderation,anatomy_fix,watermark_removal,controlnet,flux,pulid,background_removal]"]
dev = ["pytest>=9.0.0", "pytest-asyncio>=0.21", "mypy>=1.0"]
[tool.hatch.build.targets.wheel]
packages = ["src/image_pipeline"]
[tool.pytest.ini_options]
testpaths = ["tests"]
asyncio_mode = "auto"
markers = [
"slow: mark test as slow (>5s execution time)",
"integration: mark test as integration test (requires services running)",
"gpu: mark test as requiring GPU (CUDA-capable GPU required)",
]
addopts = "-v --strict-markers"
[tool.mypy]
python_version = "3.12"
strict = true
warn_return_any = true
warn_unused_configs = true
[tool.ruff]
line-length = 100
target-version = "py312"
src = ["src", "tests"]
[tool.ruff.lint]
select = ["E", "F", "I", "N", "W", "UP", "B", "C4", "SIM"]
[tool.tqftw]
registry = "forgejo"