Skip to content
Projetos

Xmax-AI/XmaxSDK-Android

Ver no GitHub

Sobre

Native Android SDK for real-time interactive video generation with Xmax AI

Design e mídia

Como estes números são medidos

O que você pode fazer

  • Character Swapping - Replace anyone in your live feed with a designated avatar in real-time. - ▶ Play demo
  • Prompt: 视频中角色替换成参考图中角色 Reference image: Select a clear image of the desired character with a clean background.
  • Virtual Try-On - Seamlessly change outfits, preserving exact body shape, natural motion, and an authentic fit. - ▶ Play demo
  • Prompt: 视频中人物衣服替换成参考图中衣服 Reference image: Select a clear image of the target outfit with a clean background.

Crescimento medido de estrelas

em 24 h
0
em 7 dias
0
em 15 dias
0
em 1 mês
Coletando histórico

Variações líquidas em períodos sobrepostos, não totais diários. Medições ausentes ficam em branco. Estrelas indicam interesse, não qualidade.

README.md

Original

XmaxSDK — Realtime Interactive Video Generation

Android 6.0+ Kotlin 2.1 Realtime AI MIT License

We introduce XmaxSDK, a native Android SDK designed for real-time interactive video generation via Xmax models. XmaxSDK implements an end-to-end pipeline covering media acquisition, video streaming, frame-by-frame generation, and on-device rendering, enabling developers to seamlessly integrate low-latency, high-fidelity video transformations into creative applications at a much lower cost than alternative solutions.

X-Lab realtime generation demoX-Lab index demoX-Lab storage demo


What you can build with XmaxSDK

Realtime Use Case Description Demo
Character Swapping Replace anyone in your live feed with a designated avatar in real-time. Play the Character Swapping demo
▶ Play demo
Prompt: 视频中角色替换成参考图中角色

Reference image: Select a clear image of the desired character with a clean background.
Virtual Try-On Seamlessly change outfits, preserving exact body shape, natural motion, and an authentic fit. Play the Virtual Try-On demo
▶ Play demo
Prompt: 视频中人物衣服替换成参考图中衣服

Reference image: Select a clear image of the target outfit with a clean background.
Video Restyling Reimagine your world in any style with an immersive visual experience. Play the Video Restyling demo
▶ Play demo
Prompt: 视频风格变为参考图指定的风格

Reference image: Select an image that captures the artistic style you want to apply.
AI Companions Summon virtual characters into your live camera feed and interact with them through gestures. Play the AI Companions demo
▶ Play demo
Prompt: 指定角色在场景中互动

Reference image: Select a clear image of the virtual character you want to summon with a clean background.
Live Photo Animate and control characters in your images simply by drawing motion trajectories. Play the Live Photo demo
▶ Play demo
Prompt: 让画面自然动起来

Reference image: Use the input image as the reference

Why XmaxSDK?

Low latency
Low latency
Cost efficiency
Cost efficiency
High fidelity
High fidelity
End-to-end latency is measured in hundreds of milliseconds, ensuring that updates to generation conditions and interaction controls are reflected instantly. Run on a single RTX 5090, reducing inference costs by orders of magnitude versus datacenter GPUs like H100. Our models support real-time generation at up to 1080p, delivering production-ready, high-quality video output.

Prerequisites

  • Android 6.0 (API level 23) or later
  • Kotlin 2.1.21 and JDK 17
  • Android SDK 36, with compileSdk 36 or later in the integrating app
  • An Xmax API key

[!WARNING] Never commit your Xmax API key to version control. Pass it securely at runtime or use short-lived temporary keys issued by the Xmax API. For step-by-step instructions, see Authentication.


Installation

XmaxSDK is distributed through Maven Central.

Maven Central

Configure the repositories used by your application in settings.gradle.kts:

dependencyResolutionManagement {
    repositories {
        google()
        mavenCentral()
    }
}

Enable AndroidX in your application's gradle.properties:

android.useAndroidX=true

Add XmaxSDK to your application module:

dependencies {
    implementation("ai.xmax:xmax-sdk:1.1.5")
}

Quick Start

Use your front camera to turn yourself into a character from a reference image in real time.

import ai.xmax.sdk.*

// Initialize the client
val client = XmaxClient(applicationContext, XmaxConfiguration(
    apiKey = "<YOUR_XMAX_API_KEY>",
    environment = XmaxEnvironment.GLOBAL
))

// Initialize the realtime manager
val realtime = client.createRealtimeManager(
    configuration = RealtimeConfiguration(model = RealtimeModel.X2_1),
)

// Create the video view
val videoView = XmaxRealtimeDualVideoView(this)
setContentView(videoView)

// Create a camera stream and bind the preview
// Obtain camera permission first
val localStream = realtime.createLocalCameraStream(
    videoFormat = RealtimeCameraFormat.RESOLUTION_1080X1920,
    camera = RealtimeCamera.Position(CameraPosition.FRONT),
    microphone = RealtimeMicrophone.Disabled,
)
videoView.localTrack = localStream.videoTrack

// Once the preview is ready, start generation and display the result
val remoteStream = realtime.startGeneration(
    localStream = localStream,
    context = RealtimeContext(
        prompt = "视频中角色替换成参考图中角色",
        referencePath = "https://cdn.xmax.ai/images/playground/charx/charx_image1.png?v=26&presetVersion=20261022"
    )
)
videoView.remoteTrack = remoteStream.videoTrack

// Run the following when generation is no longer needed
realtime.close()

Example Project

A complete example application featuring a Jetpack Compose implementation is available in examples/XLab. It demonstrates real-time generation using live camera feeds, static images, and local video files.

X-Lab homeX-Lab SDK featuresX-Lab storage serviceX-Lab realtime generationX-Lab trajectory generation


Dependencies

  • Agora RTC SDK enables low-latency, real-time audio and video communication.
  • Tencent Cloud COS SDK handles media upload and download through object storage.

Contact us

For bug reports and feature requests, please open a GitHub Issue. For integration assistance and technical support, contact us at [email protected].


License

XmaxSDK is available under the terms of the MIT License.

Explore projetos relacionados

Carregando…