Detection Page
The Detection page is where you identify traits and create masks. Good masks are essential for clean layer extraction.
Page Layout
- Canvas (center) - Shows base image with mask overlay
- Mask editor - Brush and eraser tools for refining masks
- Right panel - Trait configuration and detection results
- Thumbnail stack (bottom-right) - Switch between mask variants
- Navigation bar (top-center) - Navigate between all masks
Defining Traits
Adding Traits
- Find the Traits to Detect section in the right panel
- Click + Add Trait
- Enter a name (e.g., "eyes", "antenna", "background")
- Click Add Trait
Trait name rules:
- Use lowercase letters
- Spaces become underscores
- Keep names short for cleaner filenames
- Maximum 10 traits per project
Removing Traits
Click the × next to any trait name. If the trait has masks, variations, or layers, you'll be asked to confirm deletion.
Removing a trait deletes all associated masks, variations, layers, and combinations. This cannot be undone.
Detection Prompts
Each trait has a detection prompt that tells the AI what to find:
Default: The trait name (e.g., "eyes")
Customized: A more specific description
| Trait | Default | Better Prompt |
|---|---|---|
| eyes | eyes | the robot's large round eyes |
| antenna | antenna | the small antenna on top of the head |
| background | background | the entire background behind the character |
More specific prompts = more accurate detection.
Running Detection
Detect All
Click Detect All to run detection for every trait at once. This:
- Analyzes the base image
- Creates a mask for each trait
- Costs approximately 1 Mana per 3 traits
Single Trait Detection
- Select a trait by clicking its card
- Click Detect in the footer
- A new mask variant is created
Mask Variants
Each trait can have up to 5 mask variants (v1-v5):
- Different AI detection attempts
- Manual alternatives
- Backups before heavy editing
Favoriting: Click the star to set the favorite variant. The favorite is used for layer extraction and combinations.
Adding Mask Variants
- Click + in the thumbnail stack to add an empty slot
- Click Detect to run AI detection into a new slot
- Maximum 5 variants per trait
Deleting Mask Variants
Click the trash icon to delete the currently selected variant.
Editing Masks
Tools
| Tool | Shortcut | Function |
|---|---|---|
| Pan | P | Move around the canvas |
| Brush | B | Add to mask (paint white) |
| Eraser | E | Remove from mask (paint black) |
| Rectangle | R | Draw rectangular mask shapes |
| Circle | C | Draw circular/ellipse mask shapes |
| Polygon | — | Draw free-form polygon shapes by clicking points |
Brush Controls
- Size - Adjust with slider or scroll wheel
- Mode - Positive (add) or Negative (remove)
Shape Tools
Rectangle, Circle, and Polygon tools create persistent vector shapes that remain editable after creation:
- Draw a shape to add or subtract from the mask
- Click a shape to select it (blue outline)
- Drag a selected shape to reposition it
- Resize using corner handles
- Delete a selected shape with Backspace/Delete
- Shapes can be positive (add to mask) or negative (subtract from mask)
Polygon tool: Click to place vertices, then close the shape by clicking near the first point or double-clicking.
Shapes are saved automatically and persist across page navigation and sessions — when you return to a mask, your shapes are restored exactly as you left them.
Editing Tips
- Shift + drag - Draw straight lines
- Scroll wheel - Zoom in/out
- Scroll wheel on brush - Resize brush
- Zoom in for detail work on edges
Mask Modes
- Positive mode - Brush adds to mask, eraser removes
- Negative mode - Brush removes from mask, eraser adds
Toggle between modes using the palette controls.
Clear Mask
Click the clear button to reset the mask to empty (all black).
Layer Order
The Layer Order section controls how layers stack during combination:
1. background (back)
2. body
3. eyes
4. accessories (front)
Use the arrow buttons to reorder. Layers listed first appear behind layers listed later.
Detection Model
Currently, VariantLab uses Gemini 2.5 Flash for detection. This model is optimized for segmentation tasks.
Navigation
When editing, use the navigation bar to move between masks:
- ← → arrows - Previous/next mask across all traits
- Thumbnail stack - Switch variants within current trait
- Trait cards - Jump to a different trait
Auto-Save
Changes are automatically saved:
- Mask edits save after you stop drawing
- Settings save when you change them
- No manual save button needed
Tips
- Run Detect All first - Get initial masks, then refine
- Zoom in on edges - Clean edges = clean layer extraction
- Use negative mode - Quick way to remove large areas
- Keep multiple variants - Save your work before major edits
- Check detection prompts - Specific prompts improve accuracy
- Test with variations - Generate a quick variation to verify your mask