This folder contains a Unity sample for the Mugen3D workflow:
- Upload an image for background matting
- Poll the matting result and cache a preview locally
- Submit the processed image to Mugen3D for SQ/HQ generation
- Download the generated model package
- Preview the local result in Unity with the bundled
gsplat-unityrenderer
This sample is intended for integration reference. Configure your API credentials before using the sample.
Mugen3d_demo.mp4
APIManagerwraps login, JSON requests, image upload, polling, and file downloadAPISettingsConfigcentralizes API credentials, endpoint paths, and polling interval settings- A Project Settings entry is available at
SumeruAI/API Settings - The sample scene provides a task list UI for:
- login
- image selection
- image matting submission
- SQ/HQ generation
- download progress tracking
- local model preview
- Downloaded
.plymodel outputs can be previewed with the bundledGsplatRenderer - Task state, preview images, and downloaded files are persisted locally between sessions
Assets/SumeruAI
├─ Editor/ Editor menu and Project Settings integration
├─ Resources/ Runtime-loaded API settings assets
├─ Runtime/
│ ├─ API/ API manager and request/response models
│ ├─ Core/ Base HTTP request helpers and config object
│ ├─ Gsplat/ Gsplat-related request data
│ └─ Utils/ General file helpers
├─ Samples/
│ ├─ Scenes/ Sample scene
│ ├─ Scripts/ End-to-end sample workflow UI and storage
│ └─ Prefabs/ Sample UI prefabs
└─ ThirdParty/
├─ Gsplat/ Gsplat settings assets
└─ gsplat-unity/ Bundled third-party Gaussian splat renderer
- Open the project in Unity
2021or later. - Ensure your project is using a supported Graphics API for
gsplat-unity.- On Windows, go to
Edit > Project Settings > Player > Other Settings - Disable
Auto Graphics API for Windows - In
Graphics APIs for Windows, addVulkanorDirect3D12 - Remove unsupported graphics APIs from the list
- Unity requires a restart after switching the Graphics API
- Other target platforms may require similar graphics API adjustments
- On Windows, go to
- Configure API credentials and related settings.
- Default asset path:
Assets/SumeruAI/Resources/APISettingsConfig.asset - You can also open
SumeruAI/API Settingsfrom the Unity menu. - If you create a new config asset, it must be placed under a
Resourcesfolder and named so it can be loaded asAPISettingsConfig.
- Default asset path:
- In most cases, you only need to fill in the following fields in
APISettingsConfig:Access KeySecret Key- Create and obtain your
Access KeyandSecret Keyfrom theDeveloperspage athttps://www.sumeruai.us/ - Other configuration values are already filled with default settings in the sample.
- Only change the remaining fields if you need a custom configuration.
- The sample also includes the following configurable fields if needed:
Base UrlloginimageMattingmugen3dSq- optional polling interval for Mugen3D results
- Open the sample scene:
Assets/SumeruAI/Samples/Scenes/Samples.unity
- Press Play and use the sample UI.
- Click
Loginto obtain an access token. - Click
Select Imageand choose a local image file. - The sample uploads the source image for matting and starts polling for the result.
- When the matting output is ready, a preview image is cached locally.
- Click
Generate SQto start the first 3D generation step. - After SQ is ready, you can:
- download the SQ result
- submit HQ generation
- When a model package is available locally, click
View Modelto preview it in the built-in viewer.
- All requests are asynchronous and routed through
BaseHttpRequest APIManager.Login()stores the access token in memory and attaches it to subsequent protected requests- Matting results are queried through
GetImageMattingResult() - Mugen3D results are queried through
GetMugen3DResult() - File downloads use
DownloadHandlerFileand automatically create missing directories - The viewer documentation currently assumes local
.plymodel preview
The sample stores generated task data outside Assets under:
SumeruAI/Mugen3D
It contains:
tasks.jsonfor persisted task statePreviews/for cached matting preview imagesDownloads/for downloaded SQ/HQ model files and extracted viewer data
Runtime/API/APIManager.cs: high-level API entry pointRuntime/Core/BaseHttpRequest.cs: POST, GET, upload, and download helpersRuntime/Core/APISettingsConfig.cs: runtime API settings assetEditor/APISettingsProvider.cs: Project Settings UI for credentialsSamples/Scripts/WorkflowService.cs: workflow orchestration helpersSamples/Scripts/TaskListUI.cs: end-to-end sample UI, polling, downloading, and model viewingSamples/Scripts/GsplatLoader.cs: loads local.plyoutput into a runtimeGsplatAsset
- This project requires Unity
2021or later gsplat-unityis already bundled underAssets/SumeruAI/ThirdParty/gsplat-unity- For more detailed renderer setup notes, supported render pipelines, and platform requirements, refer to the bundled
gsplat-unitydocumentation or its GitHub repository:https://github.com/wuyize25/gsplat-unity - The current sample uses
UnityEditorfile selection for choosing local images in the Editor - Runtime file picking for standalone/mobile builds is not implemented yet
- The sample scene is designed as a functional reference, not a production-ready UI
RequestUtil.csstill contains some legacy request models, but the active sample flow in this folder is image matting and Mugen3D generation