Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

see-through-anime-layer-decomposition

БесплатноБез исполняемых скриптовНе проверен

Expertise in See-through, a framework for single-image layer decomposition of anime characters into manipulatable 2.5D PSD files using diffusion models.

reason-machinesот reason-machines★ 99 звёзд на GitHub

Об этом скилле

See-through: Anime Character Layer Decomposition

Skill by ara.so — Daily 2026 Skills collection.

See-through is a research framework (SIGGRAPH 2026, conditionally accepted) that decomposes a single anime illustration into up to 23 fully inpainted, semantically distinct layers with inferred drawing orders — exporting a layered PSD file suitable for 2.5D animation workflows.

What It Does

  • Decomposes a single anime image into semantic layers (hair, face, eyes, clothing, accessories, etc.)
  • Inpaints occluded regions so each layer is complete
  • Infers pseudo-depth ordering using a fine-tuned Marigold model
  • Exports layered .psd files with depth maps and segmentation masks
  • Supports depth-based and left-right stratification for further refinement

Installation

# 1. Create and activate environment
conda create -n see_through python=3.12 -y
conda activate see_through

# 2. Install PyTorch with CUDA 12.8
pip install torch==2.8.0+cu128 torchvision==0.23.0+cu128 torchaudio==2.8.0+cu128 \
  --index-url https://download.pytorch.org/whl/cu128

# 3. Install core dependencies
pip install -r requirements.txt

# 4. Create assets symlink
ln -sf common/assets assets

Optional Annotator Tiers

Install only what you need:

# Body parsing (detectron2 — for body attribute tagging)
pip install --no-build-isolation -r requirements-inference-annotators.txt

# SAM2 (language-guided segmentation)
pip install --no-build-isolation -r requirements-inference-sam2.txt

# Instance segmentation (mmcv/mmdet — recommended for UI)
pip install -r requirements-inference-mmdet.txt

Always run all scripts from the repository root as the working directory.

Models

Models are hosted on HuggingFace and downloaded automatically on first use:

Model HuggingFace ID Purpose
LayerDiff 3D layerdifforg/seethroughv0.0.2_layerdiff3d SDXL-based transparent layer generation
Marigold Depth 24yearsold/seethroughv0.0.1_marigold Anime pseudo-depth estimation
SAM Body Parsing 24yearsold/l2d_sam_iter2 19-part semantic body segmentation

Key CLI Commands

Main Pipeline: Layer Decomposition to PSD

# Single image → layered PSD
python inference/scripts/inference_psd.py \
  --srcp assets/test_image.png \
  --save_to_psd

# Entire directory of images
python inference/scripts/inference_psd.py \
  --srcp path/to/image_folder/ \
  --save_to_psd

Output is saved to workspace/layerdiff_output/ by default. Each run produces:

  • A layered .psd file with semantically separated layers
  • Intermediate depth maps
  • Segmentation masks

Heuristic Post-Processing

After the main pipeline, further split layers using heuristic_partseg.py:

# Depth-based stratification (e.g., separate near/far handwear)
python inference/scripts/heuristic_partseg.py seg_wdepth \
  --srcp workspace/test_samples_output/PV_0047_A0020.psd \
  --target_tags handwear

# Left-right stratification
python inference/scripts/heuristic_partseg.py seg_wlr \
  --srcp workspace/test_samples_output/PV_0047_A0020_wdepth.psd \
  --target_tags handwear-1

Synthetic Training Data Generation

python inference/scripts/syn_data.py

Python API Usage

Running the Full Pipeline Programmatically

import subprocess
import os

def decompose_anime_image(image_path: str, output_dir: str = "workspace/layerdiff_output") -> str:
    """
    Run See-through layer decomposition on a single anime image.
    Returns path to the output PSD file.
    """
    result = subprocess.run(
        [
            "python", "inference/scripts/inference_psd.py",
            "--srcp", image_path,
            "--save_to_psd",
        ],
        capture_output=True,
        text=True,
        cwd=os.getcwd()  # Must run from repo root
    )
    if result.returncode != 0:
        raise RuntimeError(f"Decomposition failed:\n{result.stderr}")
    
    # Derive expected output filename
    base_name = os.path.splitext(os.path.basename(image_path))[0]
    psd_path = os.path.join(output_dir, f"{base_name}.psd")
    return psd_path


# Example usage
psd_output = decompose_anime_image("assets/test_image.png")
print(f"PSD saved to: {psd_output}")

Batch Processing a Directory

import subprocess
from pathlib import Path

def batch_decompose(input_dir: str, output_dir: str = "workspace/layerdiff_output"):
    """Process all images in a directory."""
    result = subprocess.run(
        [
            "python", "inference/scripts/inference_psd.py",
            "--srcp", input_dir,
            "--save_to_psd",
        ],
        capture_output=True,
        text=True,
    )
    if result.returncode != 0:
        raise RuntimeError(f"Batch processing failed:\n{result.stderr}")
    
    output_psds = list(Path(output_dir).glob("*.psd"))
    print(f"Generated {len(output_psds)} PSD files in {output_dir}")
    return output_psds

# Exampl
Полный SKILL.md на GitHub

Установить see-through-anime-layer-decomposition в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл see-through-anime-layer-decomposition?

Expertise in See-through, a framework for single-image layer decomposition of anime characters into manipulatable 2.5D PSD files using diffusion models.

Как установить скилл see-through-anime-layer-decomposition?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл see-through-anime-layer-decomposition запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить see-through-anime-layer-decomposition с