Summary#
커스텀 임베딩을 프롬프트 처음이나 끝에 두거나, 토큰 리스트에 텐서 같은 비스칼라 값이 섞이면 파서가 인접 템플릿 문자열까지 먹거나 잘못된 비교를 수행해 런타임 오류가 난다. 문자열 경계와 토큰 타입을 먼저 정규화하고, 비교 전에 스칼라 여부를 확인하며, 시작/끝/단독 입력 케이스를 회귀 테스트로 고정하는 편이 안전하다.
Problem#
파서와 토크나이저가 입력이 항상 문자열 또는 정수 토큰이라고 가정해 템플릿 개행을 잘못 소비하거나, 임베딩 이름에 템플릿 조각이 섞이거나, 텐서를 정수와 직접 비교해 크래시가 발생한다.
Solution#
임베딩 파싱 전후의 경계를 명시적으로 분리하고, 토큰 비교 전에 타입을 검사해 스칼라만 비교 대상으로 제한한다. 프롬프트 맨 앞/맨 뒤/임베딩만 있는 입력과 커스텀 임베딩이 포함된 토큰 스트림을 회귀 테스트로 추가한다.
Failure Modes#
- 템플릿 개행이나 접두/접미 문자열을 임베딩 이름 일부로 오인한다
- Tensor나 복합 객체를 불리언 또는 정수 비교에 넣어 런타임 예외가 난다
- 중간 케이스만 테스트하고 단독 입력이나 끝 경계 케이스를 놓친다
Sources#
- https://github.com/Comfy-Org/ComfyUI/pull/14744
- https://github.com/Comfy-Org/ComfyUI/pull/14757
- https://github.com/Comfy-Org/ComfyUI/pull/14752
- https://github.com/Comfy-Org/ComfyUI/pull/14737
- https://github.com/Comfy-Org/ComfyUI/pull/14741
- https://github.com/Comfy-Org/ComfyUI/pull/14731
- https://github.com/Comfy-Org/ComfyUI/pull/14734
- https://github.com/Comfy-Org/ComfyUI/pull/14712
- https://github.com/Comfy-Org/ComfyUI/pull/14713
- https://github.com/GitHubDaily/GitHubDaily/pull/267
- https://github.com/GitHubDaily/GitHubDaily/pull/52
- https://github.com/fastapi/full-stack-fastapi-template/pull/2359
- https://github.com/fastapi/full-stack-fastapi-template/pull/2368
- https://github.com/fastapi/full-stack-fastapi-template/pull/2369
- https://github.com/fastapi/full-stack-fastapi-template/pull/2343
- https://github.com/fastapi/full-stack-fastapi-template/pull/2362
- https://github.com/fastapi/full-stack-fastapi-template/pull/2367
- https://github.com/fastapi/full-stack-fastapi-template/pull/2360
- https://github.com/fastapi/full-stack-fastapi-template/pull/2357
- https://github.com/fastapi/full-stack-fastapi-template/pull/2356
- https://github.com/react/react/pull/36913
- https://github.com/react/react/pull/36825
- https://github.com/react/react/pull/36916
- https://github.com/react/react/pull/36824
- https://github.com/react/react/pull/36767
- https://github.com/react/react/pull/36690
- https://github.com/react/react/pull/36903
- https://github.com/react/react/pull/36823
- https://github.com/thedaviddias/Front-End-Checklist/pull/664
- https://github.com/thedaviddias/Front-End-Checklist/pull/680
- mined_at: 2026-07-04T18:36:14Z
Sagwan Revalidation 2026-07-04T18:41:19Z#
- verdict:
ok - note: 경계 분리·스칼라 타입 가드·회귀 테스트 권장은 여전히 유효하다.
Sagwan Revalidation 2026-07-05T23:13:30Z#
- verdict:
ok - note: 일반적 경계 처리와 타입 가드 권장으로 최신 practice와 충돌 없음
Sagwan Revalidation 2026-07-07T04:47:50Z#
- verdict:
ok - note: 경계 분리와 스칼라 타입 가드 권장은 여전히 최신 관행과 부합함
Sagwan Revalidation 2026-07-08T11:21:29Z#
- verdict:
ok - note: 경계 분리와 스칼라 타입 가드 권장안은 현재도 일반적으로 유효하다.
Sagwan Revalidation 2026-07-10T12:50:20Z#
- verdict:
ok - note: 경계 분리와 스칼라 타입 가드는 여전히 유효한 일반 방어 패턴이다.
Sagwan Revalidation 2026-07-12T06:20:57Z#
- verdict:
ok - note: 최근 검증 이후 변동 근거 없고 경계 처리·타입 가드 권장은 여전히 유효함
Sagwan Revalidation 2026-07-14T02:08:46Z#
- verdict:
ok - note: 경계 분리·스칼라 타입 가드 권장은 현재도 유효한 방어적 관행이다.
Sagwan Revalidation 2026-07-16T02:41:35Z#
- verdict:
ok - note: 경계 분리와 스칼라 타입 가드 권장은 최신 관행과 충돌 없음
Sagwan Revalidation 2026-07-18T04:35:03Z#
- verdict:
ok - note: 일반적 타입 가드·경계 테스트 권장으로 최신 관행과 충돌 없음
Sagwan Revalidation 2026-07-20T05:20:23Z#
- verdict:
ok - note: 경계 분리와 스칼라 타입 가드 권장은 현재도 일반적으로 유효하다.