Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,10 @@ code use `asyncio.run(verify_client_token(token))`.
Realtime sessions accept an optional `speed` on `RealtimeConnectOptions`, alongside `resolution`.
Fast mode (`speed="fast"`) serves the session from a higher-compute tier for lower latency and
higher throughput; output quality is unchanged. It is currently available for `lucy-2.5` /
`lucy-latest`, `lucy-vton-3.5`, and `lucy-vton-3.6` / `lucy-vton-latest` (`lucy-vton-latest`
currently resolves to `lucy-vton-3.6`), in the US region only, and is billed at 2x the standard
realtime rate for those models. Other models ignore the option (the SDK emits a warning). Omit
it (the default) for standard mode.
`lucy-latest`, `lucy-2.6`, `lucy-vton-3.5`, and `lucy-vton-3.6` / `lucy-vton-latest`
(`lucy-vton-latest` currently resolves to `lucy-vton-3.6`), in the US region only, and is billed
at 2x the standard realtime rate for those models. Other models ignore the option (the SDK emits
a warning). Omit it (the default) for standard mode.

```python
from decart import DecartClient, models
Expand Down
23 changes: 21 additions & 2 deletions decart/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
# Canonical names
"lucy-2.1",
"lucy-2.5",
"lucy-2.6",
"lucy-vton-3.5",
"lucy-vton-3.6",
"lucy-restyle-2",
Expand All @@ -20,6 +21,7 @@
# Canonical names
"lucy-2.1",
"lucy-2.5",
"lucy-2.6",
"lucy-vton-3.5",
"lucy-vton-3.6",
"lucy-restyle-2",
Expand Down Expand Up @@ -82,7 +84,7 @@ def _warn_unsupported_speed(model: "ModelDefinition[Any]", speed: str) -> None:
warnings.warn(
f'Model "{model.name}" does not support speed="{speed}"; the option is ignored by the '
"server for this model. Fast mode is currently available for lucy-2.5 / lucy-latest, "
"lucy-vton-3.5, and lucy-vton-3.6 / lucy-vton-latest only. "
"lucy-2.6, lucy-vton-3.5, and lucy-vton-3.6 / lucy-vton-latest only. "
"See https://docs.platform.decart.ai/models "
"for details.",
UserWarning,
Expand Down Expand Up @@ -199,6 +201,14 @@ class ImageToImageInput(DecartBaseModel):
height=720,
supported_speeds=("fast",),
),
"lucy-2.6": ModelDefinition(
name="lucy-2.6",
url_path="/v1/stream",
fps=30,
width=1280,
height=720,
supported_speeds=("fast",),
),
"lucy-restyle-2": ModelDefinition(
name="lucy-restyle-2",
url_path="/v1/stream",
Expand Down Expand Up @@ -266,6 +276,14 @@ class ImageToImageInput(DecartBaseModel):
height=720,
input_schema=VideoEdit2Input,
),
"lucy-2.6": ModelDefinition(
name="lucy-2.6",
url_path="/v1/jobs/lucy-2.6",
fps=20,
width=1280,
height=720,
input_schema=VideoEdit2Input,
),
"lucy-vton-3.5": ModelDefinition(
name="lucy-vton-3.5",
url_path="/v1/jobs/lucy-vton-3.5",
Expand Down Expand Up @@ -376,7 +394,8 @@ def video(model: VideoModels) -> VideoModelDefinition:

Available models:
- "lucy-2.1" - Video editing (newer, higher quality)
- "lucy-2.5" - Video editing (latest generation)
- "lucy-2.5" - Video editing
- "lucy-2.6" - Video editing (latest generation)
- "lucy-restyle-2" - Video restyling with prompt or reference image
"""
_warn_deprecated(model)
Expand Down
6 changes: 3 additions & 3 deletions decart/realtime/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ class RealtimeConnectOptions:
speed: Optional[RealtimeSpeed] = None
"""Realtime speed tier. ``"fast"`` serves the session from a higher-compute tier for
lower latency and higher throughput; output quality is unchanged. Currently available
for lucy-2.5 / lucy-latest, lucy-vton-3.5, and lucy-vton-3.6 / lucy-vton-latest, in the US
region only, and billed at 2x the standard realtime rate for those models. Other models
ignore the option. Omit it (the default) for standard mode."""
for lucy-2.5 / lucy-latest, lucy-2.6, lucy-vton-3.5, and lucy-vton-3.6 / lucy-vton-latest,
in the US region only, and billed at 2x the standard realtime rate for those models. Other
models ignore the option. Omit it (the default) for standard mode."""
8 changes: 4 additions & 4 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ pip install decart[realtime]

Fast mode: pass `speed="fast"` on `RealtimeConnectOptions` to serve the session from a
higher-compute tier for lower latency and higher throughput (output quality is unchanged). It is
currently available for `lucy-2.5` / `lucy-latest`, `lucy-vton-3.5`, and `lucy-vton-3.6` /
`lucy-vton-latest`, in the US region only, and is billed at 2x the standard realtime rate for
those models. Other models ignore the option. Omit it (the default) for standard mode. The
playground exposes it as
currently available for `lucy-2.5` / `lucy-latest`, `lucy-2.6`, `lucy-vton-3.5`, and
`lucy-vton-3.6` / `lucy-vton-latest`, in the US region only, and is billed at 2x the standard
realtime rate for those models. Other models ignore the option. Omit it (the default) for
standard mode. The playground exposes it as
`python playground/playground.py --model lucy-2.5 --speed fast`.

### Running Examples
Expand Down
6 changes: 3 additions & 3 deletions examples/realtime_synthetic.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,9 @@ def on_error(error):
image=Path("examples/files/image.png"),
),
# Fast mode: uncomment with a supporting model (lucy-2.5 / lucy-latest,
# lucy-vton-3.5, lucy-vton-3.6 / lucy-vton-latest). US region only, billed
# at 2x the standard realtime rate; other models ignore it. Omit for
# standard mode.
# lucy-2.6, lucy-vton-3.5, lucy-vton-3.6 / lucy-vton-latest). US region
# only, billed at 2x the standard realtime rate; other models ignore it.
# Omit for standard mode.
# speed="fast",
),
)
Expand Down
5 changes: 3 additions & 2 deletions playground/playground.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ def _check_deps() -> None:
REALTIME_MODELS = [
"lucy-2.1",
"lucy-2.5",
"lucy-2.6",
"lucy-vton-3.5",
"lucy-vton-3.6",
"lucy-vton-latest",
Expand Down Expand Up @@ -125,8 +126,8 @@ def parse_args() -> argparse.Namespace:
choices=["fast"],
help=(
"Realtime speed tier. 'fast' uses a higher-compute tier for lower latency "
"(lucy-2.5, lucy-vton-3.5, lucy-vton-3.6 and their -latest aliases only, US region, "
"billed at 2x). Omit for standard mode."
"(lucy-2.5, lucy-2.6, lucy-vton-3.5, lucy-vton-3.6 and their -latest aliases only, "
"US region, billed at 2x). Omit for standard mode."
),
)
parser.add_argument("--camera", "-c", type=int, default=0, help="Camera device index")
Expand Down
18 changes: 17 additions & 1 deletion tests/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@ def test_canonical_realtime_models() -> None:
assert model.width == 1280
assert model.height == 720

model = models.realtime("lucy-2.6")
assert model.name == "lucy-2.6"
assert model.url_path == "/v1/stream"
assert model.fps == 30
assert model.width == 1280
assert model.height == 720
assert model.supported_speeds == ("fast",)

model = models.realtime("lucy-vton-3.5")
assert model.name == "lucy-vton-3.5"
assert model.url_path == "/v1/stream"
Expand Down Expand Up @@ -57,6 +65,13 @@ def test_canonical_video_models() -> None:
assert model.width == 1280
assert model.height == 720

model = models.video("lucy-2.6")
assert model.name == "lucy-2.6"
assert model.url_path == "/v1/jobs/lucy-2.6"
assert model.fps == 20
assert model.width == 1280
assert model.height == 720

model = models.video("lucy-vton-3.5")
assert model.name == "lucy-vton-3.5"
assert model.url_path == "/v1/jobs/lucy-vton-3.5"
Expand Down Expand Up @@ -190,14 +205,15 @@ def test_latest_aliases_no_deprecation_warning() -> None:

FAST_REALTIME_MODELS = {
"lucy-2.5",
"lucy-2.6",
"lucy-latest",
"lucy-vton-3.5",
"lucy-vton-3.6",
"lucy-vton-latest",
}


def test_realtime_fast_speed_capability_pinned_to_lucy_2_5_and_vton_3_5_3_6() -> None:
def test_realtime_fast_speed_capability_pinned_to_lucy_2_5_2_6_and_vton_3_5_3_6() -> None:
# Matches the JS SDK registry: only these realtime entries advertise speed="fast".
fast_models = {
name for name, model in _MODELS["realtime"].items() if "fast" in model.supported_speeds
Expand Down
1 change: 1 addition & 0 deletions tests/test_realtime_unit.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ async def test_realtime_connect_speed_fast_no_warning_for_supported_model():
warnings.simplefilter("always")
for model in (
"lucy-2.5",
"lucy-2.6",
"lucy-latest",
"lucy-vton-3.5",
"lucy-vton-3.6",
Expand Down
Loading