diff --git a/README.md b/README.md index 0229de5..b1f649c 100644 --- a/README.md +++ b/README.md @@ -145,7 +145,7 @@ request when unset, which selects the server defaults. (`decart::Speed::Fast`, sent as `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 + `lucy-vton-3.5` / `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 (the SDK logs a warning). Omit it (the default) for standard mode. `ModelDefinition::supportedSpeeds` lists the tiers a model advertises. diff --git a/examples/realtime_warmup.cpp b/examples/realtime_warmup.cpp index 078d6b3..31f0fe9 100644 --- a/examples/realtime_warmup.cpp +++ b/examples/realtime_warmup.cpp @@ -8,8 +8,9 @@ // // DECART_API_KEY=sk-... ./realtime_warmup [model] // -// Set DECART_SPEED=fast to request fast mode (lucy-2.5 / lucy-vton-3.5 families -// only; US region; billed at 2x the standard realtime rate). +// Set DECART_SPEED=fast to request fast mode (lucy-2.5 family and +// lucy-vton-3.5 / lucy-vton-3.6 / lucy-vton-latest only; US region; billed at +// 2x the standard realtime rate). // #include #include diff --git a/include/decart/models.h b/include/decart/models.h index 3551f79..01db330 100644 --- a/include/decart/models.h +++ b/include/decart/models.h @@ -35,7 +35,9 @@ namespace models { /// /// Accepts canonical names ("lucy-2.1", "lucy-2.5", "lucy-vton-3.5", /// "lucy-vton-3.6", "lucy-restyle-2") and server-resolved aliases -/// ("lucy-latest", "lucy-vton-latest", "lucy-restyle-latest"). +/// ("lucy-latest", "lucy-vton-latest", "lucy-restyle-latest"). Aliases are +/// resolved by the server; e.g. "lucy-vton-latest" currently serves +/// "lucy-vton-3.6". /// /// @throws Exception(ErrorCode::ModelNotFound) if the name is unknown. ModelDefinition realtime(std::string_view name); diff --git a/include/decart/realtime/realtime.h b/include/decart/realtime/realtime.h index 2188f8b..7dbe5ca 100644 --- a/include/decart/realtime/realtime.h +++ b/include/decart/realtime/realtime.h @@ -78,7 +78,7 @@ struct ConnectOptions { /// Optional compute tier. `Speed::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` (see + /// `lucy-vton-3.5` / `lucy-vton-3.6` / `lucy-vton-latest` (see /// `ModelDefinition::supportedSpeeds`), in the US region only, and billed at /// 2x the standard realtime rate for those models. Other models ignore the /// option (the SDK logs a warning). Leave unset (the default) for standard mode. diff --git a/include/decart/realtime/types.h b/include/decart/realtime/types.h index b051ac3..97349ba 100644 --- a/include/decart/realtime/types.h +++ b/include/decart/realtime/types.h @@ -29,8 +29,8 @@ const char* toString(ConnectionState state) noexcept; enum class Speed { /// Fast mode: 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 + /// for `lucy-2.5` / `lucy-latest` and `lucy-vton-3.5` / `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 it. Fast, }; diff --git a/src/models.cpp b/src/models.cpp index 60dc5cd..4783ee1 100644 --- a/src/models.cpp +++ b/src/models.cpp @@ -27,11 +27,11 @@ constexpr std::array kRealtime = {{ {"lucy-2.1", 30, 1088, 624, true}, {"lucy-2.5", 30, 1280, 720, true, /*fastSpeed=*/true}, {"lucy-vton-3.5", 30, 1280, 720, true, /*fastSpeed=*/true}, - {"lucy-vton-3.6", 30, 1280, 720, true}, + {"lucy-vton-3.6", 30, 1280, 720, true, /*fastSpeed=*/true}, {"lucy-restyle-2", 30, 1280, 704, true}, // Server-resolved "latest" aliases {"lucy-latest", 30, 1088, 624, false, /*fastSpeed=*/true}, - // Resolves server-side to lucy-vton-3.5. + // Resolves server-side to lucy-vton-3.6. {"lucy-vton-latest", 30, 1280, 720, false, /*fastSpeed=*/true}, {"lucy-restyle-latest", 30, 1280, 704, false}, }}; diff --git a/tests/test_models.cpp b/tests/test_models.cpp index d27423b..035147b 100644 --- a/tests/test_models.cpp +++ b/tests/test_models.cpp @@ -31,8 +31,9 @@ TEST_CASE("realtime() resolves canonical models with correct geometry") { CHECK(vton36.fps == 30); CHECK(vton36.width == 1280); CHECK(vton36.height == 720); - // 3.6 is not offered on the fast tier, unlike 3.5. - CHECK(vton36.supportedSpeeds.empty()); + // 3.6 is offered on the fast tier, like 3.5. + REQUIRE(vton36.supportedSpeeds.size() == 1); + CHECK(static_cast(vton36.supportedSpeeds[0]) == static_cast(Speed::Fast)); auto lucy25 = models::realtime("lucy-2.5"); CHECK(lucy25.name == "lucy-2.5"); @@ -42,11 +43,18 @@ TEST_CASE("realtime() resolves canonical models with correct geometry") { CHECK(lucy25.height == 720); } -TEST_CASE("realtime() accepts latest aliases") { +TEST_CASE("realtime() accepts latest aliases (lucy-vton-latest resolves server-side to lucy-vton-3.6)") { CHECK(models::realtime("lucy-latest").urlPath == "/v1/stream"); CHECK(models::realtime("lucy-vton-latest").name == "lucy-vton-latest"); CHECK(models::realtime("lucy-vton-latest").width == 1280); CHECK(models::realtime("lucy-vton-latest").height == 720); + // lucy-vton-latest resolves server-side to lucy-vton-3.6; the client-side + // geometry must match the model it serves. + const auto vtonLatest = models::realtime("lucy-vton-latest"); + const auto vton36 = models::realtime("lucy-vton-3.6"); + CHECK(vtonLatest.fps == vton36.fps); + CHECK(vtonLatest.width == vton36.width); + CHECK(vtonLatest.height == vton36.height); } TEST_CASE("realtime() throws ModelNotFound for unknown names") { @@ -61,7 +69,7 @@ TEST_CASE("realtime() throws ModelNotFound for unknown names") { } } -TEST_CASE("supportedSpeeds advertises fast mode on exactly the lucy-2.5 and lucy-vton-3.5 families") { +TEST_CASE("supportedSpeeds advertises fast mode on exactly the lucy-2.5 and lucy-vton-3.5/3.6 families") { // Compare via integer form: doctest stringifies enums through our ADL // toString() (which returns const char*) and cannot concatenate that. const auto fastOnly = std::vector{static_cast(Speed::Fast)}; @@ -74,9 +82,11 @@ TEST_CASE("supportedSpeeds advertises fast mode on exactly the lucy-2.5 and lucy CHECK(speeds(models::realtime("lucy-2.5")) == fastOnly); CHECK(speeds(models::realtime("lucy-latest")) == fastOnly); CHECK(speeds(models::realtime("lucy-vton-3.5")) == fastOnly); + CHECK(speeds(models::realtime("lucy-vton-3.6")) == fastOnly); CHECK(speeds(models::realtime("lucy-vton-latest")) == fastOnly); - const std::set withFast = {"lucy-2.5", "lucy-latest", "lucy-vton-3.5", "lucy-vton-latest"}; + const std::set withFast = {"lucy-2.5", "lucy-latest", "lucy-vton-3.5", "lucy-vton-3.6", + "lucy-vton-latest"}; for (const auto& m : models::listRealtime(/*canonicalOnly=*/false)) { INFO("model " << m.name); if (withFast.count(m.name)) { @@ -85,10 +95,9 @@ TEST_CASE("supportedSpeeds advertises fast mode on exactly the lucy-2.5 and lucy CHECK(m.supportedSpeeds.empty()); } } - // Every other realtime model (lucy-2.1, lucy-vton-3.6, lucy-restyle-2, lucy-restyle-latest) + // Every other realtime model (lucy-2.1, lucy-restyle-2, lucy-restyle-latest) // is standard-only. CHECK(models::realtime("lucy-2.1").supportedSpeeds.empty()); - CHECK(models::realtime("lucy-vton-3.6").supportedSpeeds.empty()); CHECK(models::realtime("lucy-restyle-2").supportedSpeeds.empty()); CHECK(models::realtime("lucy-restyle-latest").supportedSpeeds.empty()); } diff --git a/tests/test_stream_url.cpp b/tests/test_stream_url.cpp index fddcd56..b017ef8 100644 --- a/tests/test_stream_url.cpp +++ b/tests/test_stream_url.cpp @@ -86,6 +86,7 @@ TEST_CASE("supportsSpeed reflects ModelDefinition::supportedSpeeds") { CHECK(supportsSpeed(models::realtime("lucy-2.5"), Speed::Fast)); CHECK(supportsSpeed(models::realtime("lucy-latest"), Speed::Fast)); CHECK(supportsSpeed(models::realtime("lucy-vton-3.5"), Speed::Fast)); + CHECK(supportsSpeed(models::realtime("lucy-vton-3.6"), Speed::Fast)); CHECK(supportsSpeed(models::realtime("lucy-vton-latest"), Speed::Fast)); CHECK_FALSE(supportsSpeed(models::realtime("lucy-2.1"), Speed::Fast)); CHECK_FALSE(supportsSpeed(models::realtime("lucy-restyle-2"), Speed::Fast));