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
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +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` and `lucy-vton-3.5` / `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 (the SDK emits a
warning). Omit it (the default) for standard mode.
`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.

```python
from decart import DecartClient, models
Expand Down
10 changes: 6 additions & 4 deletions decart/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,9 @@ def _warn_unsupported_speed(model: "ModelDefinition[Any]", speed: str) -> None:
_warned_unsupported_speeds.add(key)
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 and "
"lucy-vton-3.5 / lucy-vton-latest only. See https://docs.platform.decart.ai/models "
"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. "
"See https://docs.platform.decart.ai/models "
"for details.",
UserWarning,
stacklevel=3,
Expand Down Expand Up @@ -231,7 +232,7 @@ class ImageToImageInput(DecartBaseModel):
height=624,
supported_speeds=("fast",),
),
# Server-side alias currently resolves to lucy-vton-3.5.
# Server-side alias currently resolves to lucy-vton-3.6.
"lucy-vton-latest": ModelDefinition(
name="lucy-vton-latest",
url_path="/v1/stream",
Expand All @@ -254,6 +255,7 @@ class ImageToImageInput(DecartBaseModel):
fps=30,
width=1280,
height=720,
supported_speeds=("fast",),
),
"lucy-restyle-latest": ModelDefinition(
name="lucy-restyle-latest",
Expand Down Expand Up @@ -322,7 +324,7 @@ class ImageToImageInput(DecartBaseModel):
height=624,
input_schema=VideoEdit2Input,
),
# Server-side alias currently resolves to lucy-vton-3.5.
# Server-side alias currently resolves to lucy-vton-3.6.
"lucy-vton-latest": ModelDefinition(
name="lucy-vton-latest",
url_path="/v1/jobs/lucy-vton-latest",
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 and lucy-vton-3.5 / 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-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."""
7 changes: 4 additions & 3 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +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` and `lucy-vton-3.5` / `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-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
5 changes: 3 additions & 2 deletions examples/realtime_synthetic.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +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-latest). US region only, billed at 2x the
# standard realtime rate; other models ignore it. Omit for standard mode.
# 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 examples/video_tryon.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
"""
Virtual Try-On Example

This example demonstrates how to use the lucy-vton-latest model to perform
virtual try-on on a video using a reference garment image.
This example demonstrates how to use the lucy-vton-latest model (currently
lucy-vton-3.6, resolved server-side) to perform virtual try-on on a video
using a reference garment image.

Usage:
# With reference image and prompt:
Expand Down
4 changes: 2 additions & 2 deletions playground/playground.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,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 and their -latest aliases only, US region, billed at 2x). "
"Omit for standard mode."
"(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."
),
)
parser.add_argument("--camera", "-c", type=int, default=0, help="Camera device index")
Expand Down
16 changes: 12 additions & 4 deletions tests/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ def test_canonical_realtime_models() -> None:
assert model.fps == 30
assert model.width == 1280
assert model.height == 720
# 3.6 is not offered on the fast tier, unlike 3.5.
assert model.supported_speeds == ()
# 3.6 is served on the fast tier, like 3.5.
assert model.supported_speeds == ("fast",)


def test_canonical_video_models() -> None:
Expand Down Expand Up @@ -136,6 +136,7 @@ def test_latest_realtime_models() -> None:
assert model.width == 1088
assert model.height == 624

# Server-side alias currently resolves to lucy-vton-3.6 (same geometry).
model = models.realtime("lucy-vton-latest")
assert model.name == "lucy-vton-latest"
assert model.url_path == "/v1/stream"
Expand All @@ -159,6 +160,7 @@ def test_latest_video_models() -> None:
assert model.width == 1088
assert model.height == 624

# Server-side alias currently resolves to lucy-vton-3.6 (same geometry).
model = models.video("lucy-vton-latest")
assert model.name == "lucy-vton-latest"
assert model.url_path == "/v1/jobs/lucy-vton-latest"
Expand Down Expand Up @@ -199,10 +201,16 @@ def test_latest_aliases_no_deprecation_warning() -> None:
assert len(w) == 0


FAST_REALTIME_MODELS = {"lucy-2.5", "lucy-latest", "lucy-vton-3.5", "lucy-vton-latest"}
FAST_REALTIME_MODELS = {
"lucy-2.5",
"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() -> None:
def test_realtime_fast_speed_capability_pinned_to_lucy_2_5_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
8 changes: 7 additions & 1 deletion tests/test_realtime_unit.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,13 @@ async def test_realtime_connect_speed_fast_no_warning_for_supported_model():
_warned_unsupported_speeds.clear()
with warnings.catch_warnings(record=True) as w:
warnings.simplefilter("always")
for model in ("lucy-2.5", "lucy-latest", "lucy-vton-3.5", "lucy-vton-latest"):
for model in (
"lucy-2.5",
"lucy-latest",
"lucy-vton-3.5",
"lucy-vton-3.6",
"lucy-vton-latest",
):
url = await _connect_and_capture_url(speed="fast", model=model)
assert "&speed=fast" in url
assert _speed_warnings(w) == []
Expand Down
Loading