Installation of Try-On with UI¶
Aiuta Try-On provides pre-built UI components and screens for implementing virtual try-on functionality in your application. This guide will walk you through implementing try-on features using the UI integration approach, which offers a complete out-of-the-box experience.
The UI integration approach is ideal for developers who want to quickly implement try-on functionality with minimal custom code while maintaining a consistent look and feel with other Aiuta features.
Dependencies¶
To use Aiuta Try On with UI components, you need to add the following dependencies to your project:
dependencies {
implementation("com.aiuta:fashionsdk-tryon-compose:<version>")
}
dependencies {
implementation "com.aiuta:fashionsdk-tryon-compose:<version>"
}
Where to find latest version of SDK?
Using Bill of Materials
To ensure consistent dependency versions and simplify version management, you can use the Bill of Materials (BOM)
dependencies {
// 1. Add BOM
implementation(platform("com.aiuta:fashionsdk-bom:<version>"))
// 2. Add all required for you dependencies
implementation("com.aiuta:fashionsdk")
implementation("com.aiuta:fashionsdk-configuration")
...
}
dependencies {
// 1. Add BOM
implementation platform("com.aiuta:fashionsdk-bom:<version>")
// 2. Add all required for you dependencies
implementation "com.aiuta:fashionsdk"
implementation "com.aiuta:fashionsdk-configuration"
...
}
Configuration¶
Before using the UI components, you need to configure AiutaConfiguration
. For detailed information about configuration options and setup, see Configuration of Try-On with UI.
The configuration allows you to customize various aspects of the try-on experience through:
- Features Configuration: Control which features are enabled in your try-on experience
- User Interface Configuration: Customize the look and feel of the UI components
Default configuration
You can use pre-built configurations for common use cases. See Default Configurations for details.
UI Entry Points¶
Aiuta Try On provides two main UI entry points for implementing virtual try-on functionality:
AiutaTryOnFlow
is the main entry point for creating new try-ons. It provides a complete flow for:
- Selecting a product to try on
- Taking or uploading a photo
- Generating and viewing the try-on result
AiutaTryOnFlow(
modifier = ...,
aiutaConfiguration = ...,
productForGeneration = ...,
)
HistoryFlow
allows users to view their try-on history and previous results. It provides:
- Ability to view and share past results
HistoryFlow(
modifier = ...,
aiutaConfiguration = ...,
)
Both flows are composable functions that can be integrated into your existing Compose UI. They handle all the necessary UI states and user interactions internally, providing a seamless try-on experience.