| name | autorig-colab-seethrough-2048 |
| description | Use when a new AUTORIG character needs HIGH-RES (2048) See-through decomposition beyond the Mac MPS 640 ceiling — driving Colab A100 via the `colab` CLI, running native inference_psd.py, converting its output to our *_layers.json with adapt_seethrough_native_to_layers.py, and feeding it into run_autorig_pipeline.py via --reuse-decomposition. Complements the Mac-512 codex skill vtube-mps-seethrough-success-pattern. |
AUTORIG 코랩 A100 2048 See-through 분해 (고해상 경로)
맥 MPS는 640이 천장이고 640px가 우리 병목([[seethrough-is-siggraph-sota]]). 2048 분해는 코랩 A100 종량제로.
검증됨: 2026-06-22 루비(010) — 21파트 2048 분해 → 어댑터 → 파이프라인 재사용빌드(45파트 리그, scale 1.0 블러 없음).
비협상 (Non-Negotiables)
- 주인님이라 부른다.
- See-through 출력을 production 성공으로 단정 금지 — 실렌더 리뷰(assembly·
/drive) 전엔 "됐다" 금지([[visual-verify-real-render]]).
- 증거 JSON·매니페스트·리뷰 JSON 삭제 금지.
- 끝나면 A100 정지(
colab stop -s sh) — 유휴 A100은 ~$1.5/hr 과금.
- ★분해 전 색 대비 확인 (동색=분리 실패): See-through는 인접·배경과 동색인 파트를 병합하거나 배경으로 오려낸다 — 흰 후드↔크림 머리=headwear로 안 잡히고 머리에 병합, 흰 블라우스 on 순백 배경=배경으로 잘려 어깨/몸통 소실(mimi 실측 2026-07-05). 마스터에 톤 대비(오프화이트·어두운 외곽선)를
style_clause(STYLE-SPEC-001)로 주고 색 거리 실측(hood↔hair·garment↔bg RGB 유클리드 >40이면 분리 쉬움, <20 위험) 후 분해. 미달이면 재생성. [[seethrough-same-color-cut-contrast]]
0. 인증·충전 (주인님 손, 브라우저 — 헤드리스 불가)
! colab pay # 종량제 충전(100CU $9.99, A100 15CU/hr≈$1.5/hr, 캐릭터당 ~$0.3~0.6)
! colab --auth oauth2 new -s sh --gpu A100 # OAuth + A100 세션 (quota 없으면 --gpu T4, 단 T4=RAM OOM/nf4 이슈)
세션 상태는 ~/.config/colab-cli/sessions.json 또는 colab sessions. A100 필수(메모리 [[seethrough-hires-colab]]: 무료 T4는 RAM 12GB OOM→nf4 느림·레이어0 실패).
1. 마스터 업로드 (2048)
colab upload -s sh experiments/<id>/generated/master.png /content/m.png
2. 환경+추론 = nohup 백그라운드 + 폴링 (websocket 타임아웃 회피)
colab exec는 30s 기본 타임아웃이고 긴 추론 중 websocket이 끊긴다(커널은 계속 돔). 그래서 추론을 VM에서 nohup 분리 실행 후 로그를 폴링한다(커널은 비어 exec-폴링 가능).
exec할 파이썬이 VM에 쓰는 run.sh:
cd /content/see-through
ln -sf common/assets assets 2>/dev/null || true
export PYTHONPATH=/content/see-through:/content/see-through/common:$PYTHONPATH
{ echo "STEP pip $(date -u)"; pip install -q -r requirements.txt 2>&1 | tail -8; echo "PIP_DONE rc=$?";
echo "STEP inference $(date -u)";
python inference/scripts/inference_psd.py --srcp /content/m.png --save_dir /content/out \
--resolution 2048 --resolution_depth 768 --tblr_split --disable_progressbar 2>&1;
echo "INFER_DONE rc=$?"; ls -la /content/out/m/optimized; echo "RUN_DONE_OK"; } > /content/run.log 2>&1
실행: exec 안에서 subprocess.Popen("nohup bash /content/run.sh >/content/nohup.out 2>&1 &", shell=True, preexec_fn=os.setpgrp).
폴링: 로컬 background Bash 루프가 colab exec로 tail /content/run.log 확인, RUN_DONE_OK면 종료.
★함정(겪음):
- pip의
ERROR: pip's dependency resolver ...는 양성 경고(PIP_DONE rc=0). 폴러 실패필터에 일반 ERROR: 넣지 말 것 — 치명만: INFER_DONE rc=[^0]|Traceback \(most recent|Killed|CUDA out of memory|No space|ModuleNotFoundError.
- 레포
https://github.com/shitagaki-lab/see-through, 스크립트 inference/scripts/inference_psd.py, 임포트가 utils.inference_utils라 PYTHONPATH에 common 필요. 모델 HF auto ~7.8G(layerdifforg/seethroughv0.0.2_layerdiff3d + 24yearsold/seethroughv0.0.1_marigold). A100서 pip+다운+추론 ~7-10분.
3. 다운로드 (zip 권장 — download는 단일파일)
# VM: cd /content/out/m && zip -r -q /content/optimized.zip optimized
colab download -s sh /content/optimized.zip experiments/<id>/colab_seethrough/optimized.zip
# 로컬: unzip → experiments/<id>/colab_seethrough/optimized/
네이티브 출력 = optimized/<tag>.png + <tag>_depth.png + info.json{parts:{tag:{xyxy:[x1,y1,x2,y2],depth_median}}, frame_size:[H,W]}.
4. 어댑터 → 우리 layers.json
python3 scripts/adapt_seethrough_native_to_layers.py \
--optimized-dir experiments/<id>/colab_seethrough/optimized --prefix <id>_seethrough
핵심: 네이티브 tag는 normalize의 target_for_tag와 이미 호환 — front hair/back hair/face/nose/mouth/neck/neckwear/topwear + side -l/-r(eyewhite/irides/eyelash/eyebrow/ears/handwear). split_side가 -l/-r 인식, base_key는 공백/언더바 정규화 → 매핑 dict 불필요. entry = {name=tag, filename, left=xyxy[0], top=xyxy[1], depth_median, depth_filename}, top-level width/height=frame_size.
5. 검증 (성역)
python3 scripts/normalize_seethrough_outputs.py --experiment-id <id> --experiment-dir experiments/<id> \
--layers-json experiments/<id>/colab_seethrough/optimized/<id>_seethrough_layers.json
기대: scale_to_2048 = [1.0, 1.0](2048 native, 업스케일 블러 없음), production_candidates ~19(front_hair·back_hair·face_base·mouth_line·neck·choker·clothes·R/L_arm·eye_white·iris·upper_lash·brow·ear_outer).
6. 파이프라인 재사용빌드 (로컬 ComfyUI 불요)
python3 scripts/run_autorig_pipeline.py --master experiments/<id>/generated/master.png \
--mouth-sheet ... --eye-expr-sheet ... --accent-sheet ... --experiment-id <id> \
--profile config/pipeline_profile.<id>.yaml --prefer-mouth-states --mouth-wide-grow \
--reuse-decomposition experiments/<id>/colab_seethrough/optimized/<id>_seethrough_layers.json --skip-gates
P1(분해) 건너뛰고 P2~P5. --skip-gates는 무인 빌드용(사람 게이트 H1.5/H2 대신 scan_rig_health.py + 실렌더 A/B로 검증).
P4에서 prune_empty_parts.py + dedup_overlap_parts.py(장식 중복 제거, DEDUP-OVERLAP-001) + defringe_white_halo.py(실루엣 흰 프린지 감쇠, DEFRINGE-HALO-001) 가 자동 실행된다. dedup=See-through가 headwear를 clothes 등에 흩뿌린 복사본을 앵커 색-일치+고립섬으로 제거(고개 돌릴 때 "뒤에 남는" 중복 해소, [[ornament-dedup-seethrough-scatter]]). defringe=실루엣 파트의 반투명 흰 가장자리를 파트 코어 밝기 상대화로 감쇠(어두운 배경서 흰 윤곽 제거, 머리색 무관).
7. 정리
colab stop -s sh # ★A100 과금 중단(잊지 말 것)
재분해 필요 시(Phase 6 reveal 각도 등) 세션 재생성 = 모델 7.8G 재다운(VM 삭제 시 캐시 휘발).