Agent Skills

source-part-segmentation

Segment overlapping visual parts from source images, wireframes, texture atlases, and decals before mesh reconstruction. Use when a mascot/logo/template contains touching or overlapping components and exact structural part masks are needed before contour-to-mesh, UV fitting, or landmark repair.

Install

npx skills add https://github.com/roble3/cc-blender-skill --skill source-part-segmentation
SKILL.md

Source Part Segmentation

Use this before contour-to-mesh when a source image contains overlapping or touching designed parts. The output is not “nice masks”; it is a source-of-truth part inventory that downstream geometry must obey.

Inputs

  • source image, wireframe, decal, or texture atlas;
  • optional manual seed manifest with named parts, polygons, seed points, rough rectangles, or HSV/color ranges;
  • source manifest with structural/decorative/context classification and expected part count.

Workflow

  1. Choose the cleanest modality: alpha, edge, dark-line, bright-on-dark, color-band, or atlas region.
  2. Extract contours and hierarchy to identify candidate objects, holes, nested details, and strokes.
  3. If components touch, run distance-transform marker watershed first.
  4. If watershed over/under-splits, switch to seeded segmentation:
    • create named part seeds (bbox, polygon, or seed_point + optional flood/HSV tolerance);
    • save one mask per named structural part;
    • mark ambiguous overlaps explicitly instead of merging them.
  5. Classify masks as structural, decorative, face_feature, aura_context, or validation_only.
  6. Pass structural masks to contour-to-mesh; pass feature masks/landmarks to landmark-fit-repair; pass atlas regions to atlas-uv-fitting.

Hard rules

  • Do not infer repeated parts from symmetry; segment what the source shows.
  • Do not merge overlapping components if the manifest expects separate structural meshes.
  • Do not proceed to final modeling when part count differs between source images; write a conflict report or canonical policy.
  • If automatic segmentation is ambiguous, write an ambiguity report and require or create manual seed rectangles/points.
  • Keep stroke/line masks separate from filled-part masks; wireframe strokes are guides unless explicitly used as the contour boundary.

Seed manifest schema

{
  "schema": "source_part_seed_manifest.v1",
  "image": "path/to/source.png",
  "parts": [
    {"name":"leaf_top", "class":"structural", "bbox":[x,y,w,h], "mode":"non_background"},
    {"name":"face_shell", "class":"structural", "polygon":[[x,y],[x,y],...], "mode":"polygon"}
  ]
}

Allowed mode values: polygon, bbox, non_background, dark_lines, bright_on_dark, hsv_range.

Scripts

  • scripts/segment_source_parts.py produces component masks and a JSON report from an image, with optional watershed.
  • scripts/seeded_part_masks.py converts a named seed manifest into deterministic named masks and a part inventory.

Sources distilled

  • OpenCV contours/hierarchy/moments are the base measurement layer.
  • OpenCV distance transform + marker watershed is the first automated split method for touching components.
  • Active contour refinement can improve a rough mask boundary after segmentation.

Related skills

ai-image-generationgenmedia-labs713KGenerate and edit images on RunComfy via the `runcomfy` CLI — a smart router across the full image-model catalog: FLUX 2 (Klein 9B/4B, Pro, Dev, Flash, Turbo, Max), Google Nano Banana 2 / Pro, OpenAI GPT Image 2, ByteDance Seedream 5 / 4-5 / 4-0 and Dreamina 4-0, Alibaba Qwen Image and Z-Image Turbo, Wan 2-7. Covers both text-to-image (t2i) and image-to-image / edit (i2i) endpoints — the skill picks the right model for the user's actual intent (typography precision, photoreal portraits, sub-secoai-image-generation101-skills547KGenerate AI images with GPT-Image-2, FLUX, Gemini, Grok, Seedream, Reve and 50+ models via inference.sh CLI. Models: GPT-Image-2, FLUX Dev LoRA, FLUX.2 Klein LoRA, Gemini 3 Pro Image, Grok Imagine, Seedream 4.5, Reve, ImagineArt. Capabilities: text-to-image, image-to-image, inpainting, LoRA, image editing, upscaling, text rendering. Use for: AI art, product mockups, concept art, social media graphics, marketing visuals, illustrations. Triggers: flux, image generation, ai image, text to image, stnano-banana-2prime-skills424KGenerate images with Google Nano Banana 2 (Gemini-family flash-tier text-to-image) on RunComfy — bundled with the model's documented prompting patterns so the skill gets sharper output than naive prompting against the same model. Documents Nano Banana 2's strengths (rapid iteration, in-image typography rendering, predictable framing, optional web-grounded context), the resolution-tier pricing, the safety-tolerance dial, and when to route to Nano Banana Pro / GPT Image 2 / Flux 2 / Seedream insteimage-editprime-skills424KEdit images on RunComfy — this skill is a smart router that matches the user's intent to the right edit model in the RunComfy catalog. Picks Nano Banana Edit (batch up to 20, identity-preserving default), OpenAI GPT Image 2 Edit (multilingual in-image text rewrite, multi-ref composition, layout precision), Flux Kontext Pro (single-ref high-fidelity local edit), or Z-Image Turbo Inpaint (mask-driven precise region edit). Bundles each model's documented prompting patterns so the skill gets sharper

Search skills and MCP servers

Fuzzy search across 23,137 skills and servers