Skip to content

Try On

Loading Screen Results Screen

Configures the core virtual try-on functionality for trying products virtually.

TryOnFeature {
  loadingPage: TryOnLoadingPageFeature // (1)!
  inputImageValidation: TryOnInputImageValidationFeature // (2)!
  cart: TryOnCartFeature // (3)!
  fitDisclaimer: TryOnFitDisclaimerFeature | null // (4)!
  feedback: TryOnFeedbackFeature | null // (5)!
  generationsHistory: TryOnGenerationsHistoryFeature | null // (6)!
  otherPhoto: TryOnWithOtherPhotoFeature | null // (7)!

  icons {
    tryOn20: Icon // (8)!
  }

  styles {
    tryOnButtonGradient: List<Color> | null // (9)!
  }

  strings {
    tryOnPageTitle: String // (10)!
    tryOn: String // (11)!
  }

  settings {
    isBackgroundExecutionAllowed: Bool // (12)!
    tryGeneratePersonSegmentation: Bool // (13)!
  }
}
  1. Configuration for the loading page displayed during the TryOn process.
  2. Configuration for validating input images before processing.
  3. Configuration for cart-related functionality in the TryOn interface.
  4. Optional configuration for displaying fit disclaimers to users.
  5. Optional configuration for collecting user feedback on TryOn results.
  6. Optional configuration for managing the history of generated TryOn results.
  7. Optional configuration for allowing users to continue with a different photo.
  8. Icon displayed for the TryOn magic button in the interface.
  9. Optional gradient colors for styling the TryOn button.
  10. Title text displayed at the top of the TryOn page.
  11. Label text used for the "Try On" buttons throughout the interface.
  12. Determines whether the SDK should wait for the generation results in the background when closed.
  13. Enables local person segmentation highlighting during loading on iOS 15+.

Sequence diagram

The sequence diagram of executing a virtual try-on operation.

sequenceDiagram
    autonumber
    actor USR as ⠀<br>User
    participant APP as Your<br>App
    participant BE as Your<br>Backend
    participant SDK as Aiuta<br>SDK
    participant API as Aiuta<br>Backend
    participant GS as Storage
    note over GS: Aiuta or Yours

    USR->>SDK: Pick a Photo / Tap Try-on button in the SDK UI
    activate SDK

    SDK->>API: Create operation<br>(image ID, product ID)
    activate API
    Note over SDK,API: Secure authenticated request
    API-->>SDK: Operation ID

    par
        API->>API: Generate image
        API->>GS: Save generated image
        deactivate API
        Note over API,GS: Anonymous.<br>The photo is associated with the<br>app entry, not the user entry
    and
        loop internal configuration delay
            SDK->>API: Request operation status
            API-->>SDK: Operation details
            Note over API,SDK: status, generated_images | error
            SDK-->>SDK: Check operation status
            Note over SDK: Repeat while<br>CREATED | IN_PROGRESS | PAUSED

        end
    end

    critical Check operation status
        option SUCCESS
            SDK->>SDK: Add images to the history
            SDK->>GS: Get result image by the URL
            activate GS
            GS-->>SDK: Image data
            deactivate GS
            SDK-->>USR: Present results
            Note over SDK,USR: User may interact with results

        option ABORTED
            rect
                SDK-->>USR: Report couldn't detect anyone
            end
            Note over SDK,USR: User may select other photo and start over

        option FAILED | CANCELLED
            rect
                SDK-->>USR: Show something went wrong error
                deactivate SDK
            end
            Note over SDK,USR: User may try again to start over
    end