Skip to main content

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

  1. Find the Traits to Detect section in the right panel
  2. Click + Add Trait
  3. Enter a name (e.g., "eyes", "antenna", "background")
  4. 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.

Cascade 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

TraitDefaultBetter Prompt
eyeseyesthe robot's large round eyes
antennaantennathe small antenna on top of the head
backgroundbackgroundthe 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

  1. Select a trait by clicking its card
  2. Click Detect in the footer
  3. 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

ToolShortcutFunction
PanPMove around the canvas
BrushBAdd to mask (paint white)
EraserERemove from mask (paint black)
RectangleRDraw rectangular mask shapes
CircleCDraw circular/ellipse mask shapes
PolygonDraw 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.

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

  1. Run Detect All first - Get initial masks, then refine
  2. Zoom in on edges - Clean edges = clean layer extraction
  3. Use negative mode - Quick way to remove large areas
  4. Keep multiple variants - Save your work before major edits
  5. Check detection prompts - Specific prompts improve accuracy
  6. Test with variations - Generate a quick variation to verify your mask