# avatar-studio Python runtime dependencies.
#
# All non-cosyvoice DashScope endpoints (wan2.2-s2v / videoretalk /
# wan2.2-animate-mix / wan2.5-i2i-preview / qwen-vl-max) are reached
# over plain HTTP via avatar_studio_inline/vendor_client.py — **no
# vendor SDK needed** for those.
#
# Cosyvoice-v2 TTS, however, is the *only* DashScope service that has
# **no synchronous HTTP endpoint** — the official path is a streaming
# WebSocket wrapped by `dashscope.audio.tts_v2.SpeechSynthesizer`.
# Reimplementing the WS protocol locally would add ~300 LOC of
# maintenance burden, so we depend on the official SDK only for TTS.
#
# The import is *lazy* (see `synth_voice` in avatar_dashscope_client.py)
# — if the SDK is missing the plugin still loads and every other mode
# (photo speak / video relip / video reface / avatar compose with
# user-supplied audio) keeps working. Only TTS / voice preview will
# raise a friendly `error_kind: dependency` until you `pip install`.
dashscope>=1.20.0

# Aliyun OSS Python SDK — used by avatar_studio_inline/oss_uploader.py to
# push user-uploaded image/video/audio (and pipeline-generated TTS audio)
# to a bucket the user owns, then hand DashScope a *signed* HTTPS URL.
#
# Required because all DashScope video models (wan2.2-s2v /
# wan2.2-animate-mix / videoretalk / wan2.2-s2v-detect) need a
# server-side-fetchable URL — the plugin's local
# `/api/plugins/avatar-studio/uploads/...` route does not satisfy that.
#
# Without `oss2` installed (or with OSS settings empty), every
# task-creation route returns HTTP 400 with a clear "configure OSS"
# hint, and the UI shows a yellow setup banner.
oss2>=2.18.0

# Audio metadata reader — used to compute the *actual* mp3/wav duration
# of cosyvoice-v2 TTS output so step 6 (s2v) gets the correct
# `duration` parameter (DashScope bills per generated second). Without
# this we fall back to a 5-second placeholder which makes the cost
# preview wildly inaccurate for anything longer than a one-liner.
mutagen>=1.47.0

# ComfyKit — Python SDK for ComfyUI (local) and RunningHub (cloud).
# Used by avatar_comfy_client.py when the user selects a non-DashScope
# backend. Import is lazy — the plugin works fine without it as long as
# only the DashScope backend is used.
comfykit>=0.1.12

# Edge-TTS — free Microsoft TTS engine via the Edge browser service.
# Used by avatar_tts_edge.py as an alternative to the paid
# cosyvoice-v2 DashScope TTS. Import is lazy — when not installed,
# selecting the Edge-TTS engine will show a friendly error.
edge-tts>=7.0
