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
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ realtime.connect(

### Fast mode

Fast mode (`speed = 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`, 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.
Fast mode (`speed = 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-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.

```kotlin
import ai.decart.sdk.realtime.Speed
Expand Down Expand Up @@ -315,6 +315,7 @@ client.queue.submit(VideoModels.LUCY_RESTYLE_2, restyle)
|-------|----------|-----------|-----|
| Lucy 2.1 | `RealtimeModels.LUCY_2_1` | 1280x720 | 30 |
| Lucy 2.5 | `RealtimeModels.LUCY_2_5` | 1280x720 | 30 |
| Lucy 2.6 | `RealtimeModels.LUCY_2_6` | 1280x720 | 30 |
| Lucy VTON 3.5 | `RealtimeModels.LUCY_VTON_3_5` | 1280x720 | 30 |
| Lucy VTON 3.6 | `RealtimeModels.LUCY_VTON_3_6` | 1280x720 | 30 |
| Lucy Restyle 2 | `RealtimeModels.LUCY_RESTYLE_2` | 1280x704 | 30 |
Expand All @@ -325,13 +326,14 @@ client.queue.submit(VideoModels.LUCY_RESTYLE_2, restyle)
|-------|----------|------------|------------|-----|
| Lucy 2.1 | `VideoModels.LUCY_2_1` | `/v1/jobs/lucy-2.1` | 1280x720 | 20 |
| Lucy 2.5 | `VideoModels.LUCY_2_5` | `/v1/jobs/lucy-2.5` | 1280x720 | 20 |
| Lucy 2.6 | `VideoModels.LUCY_2_6` | `/v1/jobs/lucy-2.6` | 1280x720 | 20 |
| Lucy VTON 3.5 | `VideoModels.LUCY_VTON_3_5` | `/v1/jobs/lucy-vton-3.5` | 1280x720 | 20 |
| Lucy VTON 3.6 | `VideoModels.LUCY_VTON_3_6` | `/v1/jobs/lucy-vton-3.6` | 1280x720 | 20 |
| Lucy Restyle 2 | `VideoModels.LUCY_RESTYLE_2` | `/v1/jobs/lucy-restyle-2` | 1280x704 | 22 |

Typed input helpers:

- `VideoEditInput` (`lucy-2.1`, `lucy-2.5`, `lucy-vton-3.5`, `lucy-vton-3.6`)
- `VideoEditInput` (`lucy-2.1`, `lucy-2.5`, `lucy-2.6`, `lucy-vton-3.5`, `lucy-vton-3.6`)
- `VideoRestyleInput` (`lucy-restyle-2`)

## API Reference
Expand Down
4 changes: 3 additions & 1 deletion sdk/src/main/java/ai/decart/sdk/RealtimeModels.kt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ object RealtimeModels {
// Canonical models
val LUCY_2_1 = RealtimeModel("lucy-2.1", "/v1/stream", 30, 1280, 720)
val LUCY_2_5 = RealtimeModel("lucy-2.5", "/v1/stream", 30, 1280, 720, setOf(Speed.FAST))
val LUCY_2_6 = RealtimeModel("lucy-2.6", "/v1/stream", 30, 1280, 720, setOf(Speed.FAST))
val LUCY_VTON_3_5 = RealtimeModel("lucy-vton-3.5", "/v1/stream", 30, 1280, 720, setOf(Speed.FAST))
val LUCY_VTON_3_6 = RealtimeModel("lucy-vton-3.6", "/v1/stream", 30, 1280, 720, setOf(Speed.FAST))
val LUCY_RESTYLE_2 = RealtimeModel("lucy-restyle-2", "/v1/stream", 30, 1280, 704)
Expand All @@ -34,6 +35,7 @@ object RealtimeModels {
// Canonical names
"lucy-2.1" -> LUCY_2_1
"lucy-2.5" -> LUCY_2_5
"lucy-2.6" -> LUCY_2_6
"lucy-vton-3.5" -> LUCY_VTON_3_5
"lucy-vton-3.6" -> LUCY_VTON_3_6
"lucy-restyle-2" -> LUCY_RESTYLE_2
Expand All @@ -46,7 +48,7 @@ object RealtimeModels {

/** All available realtime models (canonical only) */
val all: List<RealtimeModel> = listOf(
LUCY_2_1, LUCY_2_5, LUCY_VTON_3_5, LUCY_VTON_3_6, LUCY_RESTYLE_2,
LUCY_2_1, LUCY_2_5, LUCY_2_6, LUCY_VTON_3_5, LUCY_VTON_3_6, LUCY_RESTYLE_2,
LUCY_LATEST, LUCY_VTON_LATEST, LUCY_RESTYLE_LATEST,
)
}
6 changes: 5 additions & 1 deletion sdk/src/main/java/ai/decart/sdk/VideoModels.kt
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ object VideoModels {
/** Lucy 2.5 video editing with optional reference image. Output: 1280x720, 20fps. */
val LUCY_2_5 = VideoModel("lucy-2.5", "/v1/jobs/lucy-2.5", 20, 1280, 720, ModelInputType.VIDEO_EDIT)

/** Lucy 2.6 video editing with optional reference image. Output: 1280x720, 20fps. */
val LUCY_2_6 = VideoModel("lucy-2.6", "/v1/jobs/lucy-2.6", 20, 1280, 720, ModelInputType.VIDEO_EDIT)

/** Lucy virtual try-on 3.5 video editing. Output: 1280x720, 20fps. */
val LUCY_VTON_3_5 = VideoModel("lucy-vton-3.5", "/v1/jobs/lucy-vton-3.5", 20, 1280, 720, ModelInputType.VIDEO_EDIT)

Expand All @@ -72,6 +75,7 @@ object VideoModels {
val all: List<VideoModel> = listOf(
LUCY_2_1,
LUCY_2_5,
LUCY_2_6,
LUCY_VTON_3_5,
LUCY_VTON_3_6,
LUCY_RESTYLE_2,
Expand All @@ -83,7 +87,7 @@ object VideoModels {
/** All models including deprecated names */
@Suppress("DEPRECATION")
val allIncludingDeprecated: List<VideoModel> = listOf(
LUCY_2_1, LUCY_2_5, LUCY_VTON_3_5, LUCY_VTON_3_6, LUCY_RESTYLE_2,
LUCY_2_1, LUCY_2_5, LUCY_2_6, LUCY_VTON_3_5, LUCY_VTON_3_6, LUCY_RESTYLE_2,
LUCY_LATEST, LUCY_VTON_LATEST, LUCY_RESTYLE_LATEST,
LUCY_RESTYLE_V2V,
)
Expand Down
2 changes: 1 addition & 1 deletion sdk/src/main/java/ai/decart/sdk/realtime/RealTimeClient.kt
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ enum class Resolution(val value: String) {
* Realtime compute tier. Fast mode ([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` (see
* `lucy-2.6`, `lucy-vton-3.5`, and `lucy-vton-3.6` / `lucy-vton-latest` (see
* [RealtimeModel.supportedSpeeds]), 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.
Expand Down
25 changes: 19 additions & 6 deletions sdk/src/test/java/ai/decart/sdk/RealtimeModelsTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@ class RealtimeModelsTest {

@Test
fun `all models have correct count`() {
assertEquals(8, RealtimeModels.all.size)
assertEquals(9, RealtimeModels.all.size)
}

@Test
fun `fromName returns correct model for canonical names`() {
assertEquals(RealtimeModels.LUCY_2_1, RealtimeModels.fromName("lucy-2.1"))
assertEquals(RealtimeModels.LUCY_2_5, RealtimeModels.fromName("lucy-2.5"))
assertEquals(RealtimeModels.LUCY_2_6, RealtimeModels.fromName("lucy-2.6"))
assertEquals(RealtimeModels.LUCY_VTON_3_5, RealtimeModels.fromName("lucy-vton-3.5"))
assertEquals(RealtimeModels.LUCY_VTON_3_6, RealtimeModels.fromName("lucy-vton-3.6"))
assertEquals(RealtimeModels.LUCY_RESTYLE_2, RealtimeModels.fromName("lucy-restyle-2"))
Expand Down Expand Up @@ -61,6 +62,17 @@ class RealtimeModelsTest {
assertEquals(720, RealtimeModels.LUCY_2_5.height)
}

@Test
fun `lucy-2_6 matches JS SDK registry`() {
assertEquals(RealtimeModels.LUCY_2_6, RealtimeModels.fromName("lucy-2.6"))
assertEquals("lucy-2.6", RealtimeModels.LUCY_2_6.name)
assertEquals("/v1/stream", RealtimeModels.LUCY_2_6.urlPath)
assertEquals(30, RealtimeModels.LUCY_2_6.fps)
assertEquals(1280, RealtimeModels.LUCY_2_6.width)
assertEquals(720, RealtimeModels.LUCY_2_6.height)
assertEquals(setOf(Speed.FAST), RealtimeModels.LUCY_2_6.supportedSpeeds)
}

// lucy-latest resolves server-side to lucy-2.5, so it shares its 720p geometry.
@Test
fun `lucy latest matches lucy 2_5 geometry`() {
Expand Down Expand Up @@ -96,13 +108,14 @@ class RealtimeModelsTest {
}
}

// Fast mode is declared server-side only for lucy-2.5 / lucy-vton-3.5 /
// lucy-vton-3.6 (and their -latest aliases). Keep this pinned so no other
// model advertises it.
// Fast mode is declared server-side only for lucy-2.5 / lucy-2.6 /
// lucy-vton-3.5 / lucy-vton-3.6 (and their -latest aliases). Keep this
// pinned so no other model advertises it.
@Test
fun `fast speed capability is pinned to lucy 2_5 and lucy vton 3_5 and 3_6 families`() {
fun `fast speed capability is pinned to lucy 2_5 and 2_6 and lucy vton 3_5 and 3_6 families`() {
val fastModels = setOf(
RealtimeModels.LUCY_2_5,
RealtimeModels.LUCY_2_6,
RealtimeModels.LUCY_LATEST,
RealtimeModels.LUCY_VTON_3_5,
RealtimeModels.LUCY_VTON_3_6,
Expand All @@ -115,7 +128,7 @@ class RealtimeModelsTest {
assertTrue("${model.name} must not advertise fast mode", model.supportedSpeeds.isEmpty())
}
assertEquals(
setOf("lucy-2.5", "lucy-latest", "lucy-vton-3.5", "lucy-vton-3.6", "lucy-vton-latest"),
setOf("lucy-2.5", "lucy-2.6", "lucy-latest", "lucy-vton-3.5", "lucy-vton-3.6", "lucy-vton-latest"),
RealtimeModels.all.filter { Speed.FAST in it.supportedSpeeds }.map { it.name }.toSet(),
)
}
Expand Down
12 changes: 11 additions & 1 deletion sdk/src/test/java/ai/decart/sdk/VideoModelsTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import org.junit.Test
class VideoModelsTest {
@Test
fun `video models match JS SDK registry`() {
assertEquals(8, VideoModels.all.size)
assertEquals(9, VideoModels.all.size)
assertEquals(VideoModels.LUCY_2_1, VideoModels.fromName("lucy-2.1"))
assertEquals(20, VideoModels.LUCY_2_1.fps)
assertEquals(1280, VideoModels.LUCY_2_1.width)
Expand All @@ -24,6 +24,16 @@ class VideoModelsTest {
assertEquals(ModelInputType.VIDEO_EDIT, VideoModels.LUCY_2_5.inputType)
}

@Test
fun `lucy-2_6 matches JS SDK registry`() {
assertEquals(VideoModels.LUCY_2_6, VideoModels.fromName("lucy-2.6"))
assertEquals("/v1/jobs/lucy-2.6", VideoModels.LUCY_2_6.jobsUrlPath)
assertEquals(20, VideoModels.LUCY_2_6.fps)
assertEquals(1280, VideoModels.LUCY_2_6.width)
assertEquals(720, VideoModels.LUCY_2_6.height)
assertEquals(ModelInputType.VIDEO_EDIT, VideoModels.LUCY_2_6.inputType)
}

// lucy-latest resolves server-side to lucy-2.5, so it shares its 720p geometry.
@Test
fun `lucy-latest matches JS SDK registry`() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ class RealTimeClientUrlTest {
val logger = RecordingLogger()
warnIfSpeedUnsupported(RealtimeModels.LUCY_2_1, null, logger)
warnIfSpeedUnsupported(RealtimeModels.LUCY_2_5, Speed.FAST, logger)
warnIfSpeedUnsupported(RealtimeModels.LUCY_2_6, Speed.FAST, logger)
warnIfSpeedUnsupported(RealtimeModels.LUCY_LATEST, Speed.FAST, logger)
warnIfSpeedUnsupported(RealtimeModels.LUCY_VTON_3_5, Speed.FAST, logger)
warnIfSpeedUnsupported(RealtimeModels.LUCY_VTON_3_6, Speed.FAST, logger)
Expand Down