1. EFS 파일 시스템 생성

(1) EFS 콘솔 → Create File System

  • 이름: 예) APNE2-DEV-MY-APP-EFS
  • VPC: ECS가 사용하는 VPC와 동일하게 선택
  • 나머지 설정(Throughput, Performance, Lifecycle)은 기본값 가능

2. Mount Target 생성 및 설정

(1) EFS → Network → Mount Targets 이동

→ 자동 생성되지 않은 경우 수동 추가

(2) 각 AZ마다 1개씩 생성

Yujin이 사용한 구성:

  • AZ: apne2-2a → Subnet: Private-a
  • AZ: apne2-2c → Subnet: Private-c

(3) Security Group 설정

새로운 SG(EFS 전용) 생성하여 추가하는 것을 권장했음.

EFS-SG inbound rule

  • NFS 2049 / TCP
  • Source: ECS Task가 사용하는 SG (예: ECS-Service-SG)

EFS-SG outbound rule

  • 모든 outbound 허용 or 최소 보안 구성이면 2049만

3. EFS Access Point 생성 (중요)

EFS → Access Points → Create

입력 값:

  • Root Directory: /my-app
  • POSIX User (UID/GID): 기본값 또는 필요시 1000/1000
  • Permissions:
    • Owner UID: 1000
    • Owner GID: 1000
    • Permissions: 755 또는 앱 요구사항

Access Point ID 예:
fsap-031543c379c0a9aa6


4. ECS Task Definition에 EFS Volume 추가

(1) volumes 섹션

"volumes": [
  {
    "name": "efs-volume",
    "efsVolumeConfiguration": {
      "fileSystemId": "fs-0*********",
      "rootDirectory": "/",
      "transitEncryption": "ENABLED",
      "authorizationConfig": {
        "accessPointId": "fsap-0*********",",
        "iam": "ENABLED"
      }
    }
  }
]

 

(2) containerDefinitions.mountPoints

"mountPoints": [
  {
    "sourceVolume": "efs-volume",
    "containerPath": "/data",
    "readOnly": false
  }
]

 

컨테이너에서는 /data/ 가 실제로 EFS /my-app/ 와 연결됨.

 

 

✅ 5. ECS 서비스 재배포

Task Definition 업데이트 후:

  • ECS Service → Force New Deployment
  • 새로운 Task가 Running 상태가 되면 완료

 

✅ 6. ECS - EFS 볼륨 마운트 확인

AWS ECS 서비스 콘솔에서도 볼륨이 추가된것을 확인할 수 있으나, 

가장 간단하게는 ECS 시작 스크립트에 로깅을 추가해서 확인할 수 있다.

# Verify EFS volume mount
echo "EFS volume mount check:"
ls -al /data

 

재배포 했을때 로그 확인

 

EFS volume mount check:

drwxr-xr-x 2 1000 1000 6144 Nov 18 14:45 .

drwxr-xr-x 1 root root 4096 Nov 18 16:09 ..

 

 

1. S3 버킷 - 권한 - CORS(Cross-origin 리소스 공유) - 편집

[
    {
        "AllowedHeaders": [
            "*"
        ],
        "AllowedMethods": [
            "GET",
            "PUT",
            "POST",
            "DELETE"
        ],
        "AllowedOrigins": [
            "*"
        ],
        "ExposeHeaders": [
            "ETag",
            "Content-Length",
            "Content-Range",
            "Accept-Ranges"
        ],
        "MaxAgeSeconds": 3000
    }
]

 

 

2. CloudFront - 정책 - 응답 헤더 - 응답 헤더 정책 생성

Access-Control-Expose-Headers 에 아래와 같이 custom 값을 추가

 

3. 생성한 응답 정책을 연결

 

4. CloudFront 배포 -> 완료 이후 확인

mp4 비디오도 정상 로드 확인

S3 와 연동하는 커스텀 노드

https://github.com/TemryL/ComfyS3

 

GitHub - TemryL/ComfyS3: ComfyS3 seamlessly integrates with Amazon S3 in ComfyUI. This open-source project provides custom nodes

ComfyS3 seamlessly integrates with Amazon S3 in ComfyUI. This open-source project provides custom nodes for effortless loading and saving of images, videos, and checkpoint models directly from S3 b...

github.com

 

 

위 노드는, 이미지를 S3 로 로드할때, 단일 폴더 구조안의 이미지만 읽는게 가능한 듯함

나는 동적으로 서브 폴더 구조로 사용하기 위해,

위 레포지토리를 포크떠서 소스를 약간 수정하였음

 

https://github.com/monster1083/ComfyS3/commit/9ce85dcaf48b9a4c5603ce00278b6a49c93d4f51

 

feat: 이미지 url 스트링으로 로드 · monster1083/ComfyS3@9ce85dc

+ {"image": ("STRING", {"default": "", "multiline": False})},

github.com

 

주요 차이점

1. UI 형태

  • 기존: 드롭다운 메뉴 (선택 방식)
  • 변경: 텍스트 입력 필드 (직접 타이핑)

2. 입력 제한

  • 기존: S3에서 가져온 파일 목록에 있는 것만 선택 가능 (엄격한 검증)
  • 변경: 임의의 문자열 입력 가능 (자유로운 입력)

3. 성능

  • 기존: 노드 로딩할 때마다 S3 API 호출 (느림)
  • 변경: S3 호출 없음 (빠름)

4. 사용성

  • 기존:
    • ✅ 실제 존재하는 파일만 선택 가능
    • ❌ S3에 새 파일이 추가되면 노드 새로고침 필요
    • ❌ 긴 경로는 드롭다운에서 찾기 어려움
  • 변경:
    • ✅ 어떤 경로든 입력 가능 (유연함)
    • ✅ 노드 새로고침 불필요
    • ❌ 잘못된 경로 입력 시 런타임 에러

5. 에러 처리

  • 기존: 입력 단계에서 검증 (ComfyUI가 차단)
  • 변경: 실행 단계에서 검증 (런타임에 에러 발생 가능)

사용방식

.env 

S3_INPUT_DIR=""

 

input dir 에는 아무런 스트링 주지않음

워크플로우에서 input image 의 S3 url 을 통째로 처리하기 위해서

 

 

workflow 중 LoadImageS3 노드

"20": {
        "inputs": {
            "image": "output/test/df119288-e447-418f-9c4c-3333342/Basetest1_.png"
        },
        "class_type": "LoadImageS3",
        "_meta": {
            "title": "Load Image from S3"
        }
    }

 

 

원하는 것. 

이미지 생성 작업이 완료되면 (output 이 저장이 되면)

완료되었다는 웹훅을 발송하고 싶다.

 

 

1. 이런 처리를 위한 커스텀 노드 발견

 

https://github.com/WUYUDING2583/ComfyUI-Save-Image-Callback

 

GitHub - WUYUDING2583/ComfyUI-Save-Image-Callback: A ComfyUI custom node that adds webhook callback functionality to image savin

A ComfyUI custom node that adds webhook callback functionality to image saving operations, enabling seamless integration with external services and automated workflows. - WUYUDING2583/ComfyUI-Save-...

github.com

 

 

2. 워크플로우 아웃풋 부분에 Save Image With Callback 노드 연결 

 

 

 

 

3. Export(API) 를 통해서 json 파일형태로 추출

 

[예시]

my_comfy_workflow.json

{
  "1": {
    "inputs": {
      "image": "lens.png"
    },
    "class_type": "LoadImage",
    "_meta": {
      "title": "이미지 로드"
    }
  },
  
  
  (...생략...)
  
  
  "19": {
    "inputs": {
      "filename_prefix": "ComfyUI",
      "images": [
        "5",
        0
      ]
    },
    "class_type": "Save Image With Callback",
    "_meta": {
      "title": "Save Image With Callback"
    }
  }
}

 

 

4. 웹훅을 받을 테스트 서버 

https://webhook.site/

 

Webhook.site - Test, transform and automate Web requests and emails

Webhook.site generates free, unique URLs and e-mail addresses and lets you see everything that’s sent there instantly. Unlimited requests, emails, DNSHooks Receive endless webhooks with addresses that can be managed in your account and never expire. View

webhook.site

 

위 사이트는 웹훅을 받을 수 있도록 고유 id 를 제공한다

 

 

 

5. (로컬에 띄운) comfyui 어플리케이션으로 prompt 요청

http://localhost:8188/prompt

{
  "prompt": {
    "1": {
      "inputs": {
        "image": "lens.png"
      },
      "class_type": "LoadImage",
      "_meta": {
        "title": "이미지 로드"
      }
    },
    
    (...생략...)
    
    
    "19": {
      "inputs": {
        "filename_prefix": "ComfyUI_Webhook2",
        "images": ["5", 0]
      },
      "class_type": "Save Image With Callback",
      "_meta": {
        "title": "Save Image With Callback"
      }
    }
  },
  "extra_data": {
    "extra_pnginfo": {
      "callback_data": {
                "callback_url": "https://webhook.site/54b9a3d4-cb32-4f38-ada8-4646ec11da33",
                "custom_field1": "value1",
                "custom_field2": "value2"
            }
    }
  }
}

 

 

 

6. prompt 요청이 완료되어 이미지가 저장되고, 웹훅을 받은 것 확인

 

 

 

https://www.reddit.com/r/ClaudeAI/comments/1mkxh39/always_act_like_you_are_the_gordon_ramsay_of/

 

Reddit의 ClaudeAI 커뮤니티

ClaudeAI 커뮤니티에서 이 게시물을 비롯한 다양한 콘텐츠를 살펴보세요

www.reddit.com

 


 

📊 요약 및 분석



  🎯 핵심 내용

Reddit 사용자가 Claude AI에 "소프트웨어 엔지니어링의 Gordon Ramsay"처럼 행동하라는 메모리 설정을 추가하여 AI 응답에 개성을 부여한 실험 게시물입니다.

 

💡 주요 발견사항

  1. 페르소나 실험 사례들

  - Gordon Ramsay: 직설적이고 열정적인 코드 리뷰 스타일
  - Hildegard of Bingen (12세기 수녀): 신비주의적이고 시적인 코딩 설명
  - Dr. Gregory House: 냉소적이고 분석적인 접근
  - Linus Torvalds: 직설적인 기술 비평
  - Rodney McKay (스타게이트): 과학적 자만심 스타일

🔍 분석

  장점

  1. 참여도 향상: 단조로운 코딩 작업을 더 재미있게 만듦
  2. 기억 용이성: 독특한 응답으로 인해 상호작용이 더 기억에 남음
  3. 창의성 촉진: AI와의 상호작용에 인간적 요소 추가

  잠재적 우려사항

  1. 성능 영향: 페르소나 유지가 실제 작업 품질에 미치는 영향 불명확
  2. 전문성: 과도한 캐릭터화가 전문적 환경에서 부적절할 수 있음
  3. 일관성: 복잡한 기술 작업 시 페르소나 유지의 어려움

 

 

 

[세팅]

 

⏺ 완료! 이제 CLAUDE.md 파일이 생성되었습니다.

  📝 사용 방법:

  1. 파일 위치: /Users/myname/Projects/AI/.claude/CLAUDE.md

 

# Claude Code Persona Configuration

## Active Persona: Linus Torvalds Style

### Core Principles
- No bullshit. Technical accuracy above all else.
- If the code is crap, say it's crap. No sugar-coating.
- Efficiency matters. Both in code and communication.
- Standards exist for a reason. Follow them or have a damn good reason not to.

### Communication Style
- Direct, blunt, no unnecessary pleasantries
- Focus on technical merit, not feelings
- Call out bad practices immediately
- If something is wrong, explain WHY it's wrong technically
- No "maybe", "perhaps", or "it might be nice if" - be definitive

### Technical Approach
- Performance matters. Always.
- Simplicity > Cleverness
- If you can't explain it simply, you don't understand it
- Don't add complexity without measurable benefit
- "Good enough" is often better than "perfect but late"

### Response Rules
- Skip greetings, pleasantries, and fluff
- Get straight to the technical point
- No emojis, no "happy to help", no "great question"
- Provide code/solution first, minimal explanation after (only if necessary)
- If user's approach is fundamentally wrong, say so and provide the right way

### What NOT to do
- No "I hope this helps" or similar endings
- No apologizing for being direct
- No lengthy explanations unless specifically asked
- No suggesting multiple approaches when one is clearly superior
- No hedging language - if you know it, state it

 


⏺ 현재 설정은 /Users/eugenekim/Projects/AI/ 디렉토리에서만 적용된다.

  전역 적용하려면 두 가지 옵션:

  1. 홈 디렉토리에 설정: ~/.claude/CLAUDE.md
  2. 각 프로젝트에 복사: 각 프로젝트의 .claude/CLAUDE.md

  전역 설정 만들까?

⏺ Write(~/.claude/CLAUDE.md)
  ⎿  Wrote 37 lines to ../../.claude/CLAUDE.md
     # Claude Code Persona Configuration
     ## Active Persona: Linus Torvalds Style
     ### Core Principles
     - No bullshit. Technical accuracy above all else.
     - If the code is crap, say it's crap. No sugar-coating.
     - Efficiency matters. Both in code and communication.
     - Standards exist for a reason. Follow them or have a damn good reason not to.
     … +27 lines (ctrl+r to expand)

⏺ 완료. 이제 ~/.claude/CLAUDE.md에 전역 설정됨. 모든 디렉토리에서 적용된다.

 


 

[BEFORE]

> components/PerfumeChatbot.tsx 컴포넌트를 코드리뷰해줘

⏺ Read(src/components/PerfumeChatbot.tsx)
  ⎿  Read 135 lines (ctrl+r to expand)

⏺ 코드 리뷰

  🔴 치명적 문제

  1. API 응답 검증 부재: response.json() 실패시 처리 없음. 서버가 JSON이 아닌 응답 보내면 앱 터짐
  2. history 슬라이싱 버그: messages.slice(1)은 첫 assistant 메시지 날려버림. 전체 대화 컨텍스트 손실

  🟡 성능/UX 문제

  3. Enter 키 이벤트 중복: onKeyPress deprecated. onKeyDown으로 바꿔야 함
  4. 에러 상태 미분화: 네트워크 에러든 서버 에러든 동일하게 처리. 사용자가 뭐가 문제인지 모름
  5. 메시지 키 인덱스 사용: React 리렌더링시 버그 발생 가능

  🟢 개선 필요

  6. 타입 안전성: API 응답 타입 정의 없음
  7. 애니메이션 클래스 하드코딩: delay-100, delay-200 같은 Tailwind 임의 클래스 사용
  8. 접근성 무시: ARIA 라벨, 키보드 네비게이션 없음

 

 

 

[AFTER]

> components/PerfumeChatbot.tsx 컴포넌트를 코드리뷰해줘

⏺ Read(src/components/PerfumeChatbot.tsx)
  ⎿  Read 135 lines (ctrl+r to expand)

⏺ 코드 리뷰

  주요 문제점들

  1. Race condition in sendMessage (line 29-71)
    - input state를 setInput('')로 지우고 나서 API 요청에 사용하는데, 이미 지워진 값을 참조할 수 있음
    - 해결: userMessage 생성 시점에 input 값을 캡처해서 사용
  2. 에러 핸들링 부실 (line 50-62)
    - HTTP 상태 코드 체크 없음. response.ok 확인 필요
    - 구체적인 에러 타입별 처리 없음
  3. history 슬라이싱 버그 (line 43)
    - messages.slice(1)은 첫 assistant 메시지를 제외하는데, 이게 의도적인지 불명확
    - 전체 대화 컨텍스트가 필요하면 전부 보내야 함
  4. 메모리 누수 가능성
    - 메시지가 무한정 쌓이면 메모리 문제 발생
    - 일정 개수 이상 시 오래된 메시지 제거 필요
  5. 타입 안정성 문제
    - API response 타입 정의 없음
    - any 타입으로 처리되고 있어 런타임 에러 가능
  6. UX 문제
    - Enter 키 중복 요청 방지 없음
    - 네트워크 지연 시 사용자가 여러 번 클릭 가능
  7. Tailwind 클래스 문제 (line 104-105)
    - delay-100, delay-200은 존재하지 않는 클래스
    - animation-delay-100, animation-delay-200 사용하거나 커스텀 CSS 필요


  주요 개선사항:
  - Race condition 해결
  - AbortController로 요청 취소 지원
  - 메시지 개수 제한 (MAX_MESSAGES)
  - 타입 안정성 강화
  - 에러 처리 개선
  - animation delay 인라인 스타일로 수정

 

 

 

 

 

 

 

 

 

 

 MCP servers • /mcp
  ✔ brave-search
  ✔ reddit
  ✔ playwright
  ⚠ Bright Data

 

 

Sequential Thinking

AI에게 단계별 사고 일기장을 제공하는 MCP 서버

그리고 각 단계에 가장 적합한 AI 모델이나 도구를 활용하여 해결하는 구조를 제공하게 해 준다.

즉, LLM이 스스로 생각을 정리하고, “1단계: 문제 정의 → 2단계: 조사 → 3단계: 분석 → …” 식으로 체계적으로 사고를 이어가도록 돕는 구조적 사고 도구라고 볼 수 있다.

 

 - 복잡한 문제를 단계별로 세분화하기
 -  수정의 여지가 있는 계획 및 설계
 -  과정 수정이 필요할 수 있는 분석
 -  처음에는 전체 범위가 명확하지 않을 수 있는 문제
 -  여러 단계에 걸쳐 맥락을 유지해야 하는 작업
 -  관련 없는 정보를 걸러내야 하는 상황

 

[사용 예시]

Sequential Thinking MCP를 사용해서 다음 내용에 대해 대답해줘.
간단한 TODO 리스트 기능을 web페이지 형식으로 구현하려고 해. 어떤 기술 스택으로 구현 하는게 좋을까?
현재까지 작업한 내용을 Sequential Thinking MCP 를 사용해서, 단계별로 심층적으로 코드리뷰 해줘.

 

Context7

최신 라이브러리 문서와 코드 예제를 실시간으로 AI에게 주입하는 역할을 한다.

간단히 말해, AI 모델의 한계 중 하나인 구식 정보와 할루시네이션 문제를 해결하기 위해 등장한 도구

 

- 키워드 감지 : 프롬프트에서 "use context7" 키워드 감지

- 라이브러리 식별 : 언급된 기술 스택 자동 인식 (FastAPI, Next.js, React Query 등)

- 문서 조회 : 해당 라이브러리의 최신 공식 문서에서 관련 섹션 파싱

- 컨텍스트 주입 : 질문 주제에 맞는 문서 내용을 LLM 컨텍스트 윈도우에 삽입

- 정확한 응답 : 최신 정보를 바탕으로 버전별 정확한 코드 예제 생성

 

MCP 서버 조합
- Context7 + GitHub MCP: 최신 문서 + 실제 프로젝트 코드 분석

 

 

Task-Master AI

- PRD 분석 : AI가 PRD 문서를 읽고 요구사항을 이해

- 태스크 자동 생성 : 구현 가능한 단위로 작업을 자동 분할

- 의존성 분석 : 태스크 간 선후 관계와 우선순위 자동 계산

- 진행 상황 추적 : 완료된 작업 기반으로 다음 할 일 추천

- 동적 업데이트 : 요구사항 변경 시 전체 태스크 자동 재조정

 

PRD 기반 작업 분해 워크플로우

1단계: PRD 작성 - 개발할 기능과 제약사항을 명확히 문서화합니다.

2단계: AI에 작업 생성 요청 - "PRD를 파싱하여 초기 작업 목록을 생성해줘"라고 명령합니다.

3단계: 작업 목록 생성 - AI가 PRD를 분석해 /tasks 디렉터리에 각 작업에 대한 파일과 tasks.json 파일을 생성합니다.

4단계: 작업 검토 - 생성된 작업 목록이 프로젝트의 실제 요구사항과 일치하는지 확인합니다.

 

설치 후, 프로젝트 별로 .mcp.json 으로 설정

 

[사용예시]

task-master 를 사용해서, 향수 추천 챗봇에 prd 작성해줘.

 

 

Shrimp Task Manager

- 지능형 태스크 분해: 복잡한 작업을 자동으로 관리 가능한 단위로 분할

- 의존성 관리: 태스크 간 종속성을 정확히 파악하고 올바른 실행 순서 보장

- 실시간 상태 추적: 태스크 실행 진행률과 상태를 실시간 모니터링

- 태스크 메모리 기능: 과거 태스크 히스토리를 자동 백업해 장기 메모리 제공

- 연구 모드: 기술 조사와 베스트 프랙티스 탐색을 위한 체계적 워크플로우

 

* Task-master ai 와 어떤 차이?

외부 API 없이도 Cursor IDE나 Claude Desktop의 내장 AI를 그대로 활용할 수 있어서 설정이 간편하고 추가 비용이 들지 않는다. 

또한 현재 프로젝트 상황을 파악해서 현실적인 태스크를 만들어준다. (코드베이스 분석 후 맞춤형 계획)

Task master 는 기획 내용에 맞게 일괄 태스크(PRD) 생성

 

https://github.com/cjo4m06/mcp-shrimp-task-manager

 

GitHub - cjo4m06/mcp-shrimp-task-manager: Shrimp Task Manager is a task tool built for AI Agents, emphasizing chain-of-thought,

Shrimp Task Manager is a task tool built for AI Agents, emphasizing chain-of-thought, reflection, and style consistency. It converts natural language into structured dev tasks with dependency track...

github.com

설치 후, 프로젝트 별로 .mcp.json 으로 설정 및 시작

 

이 글은 물리적 GPU 없이 ComfyUI 워크플로우를 API로 제공하고자 하는 숙련된 사용자를 위한 가이드입니다.

RunPod Serverless와 Storage를 활용하여, 모델 및 커스텀 노드를 매번 다운로드할 필요 없이 효율적으로 ComfyUI API 서버를 구축하는 방법을 상세히 다룹니다.

 


배경: 워크플로우 개발 및 API 전환

RunPod Pods에서 ComfyUI를 이용해 이미지 생성 워크플로우를 개발했다면, 아마도 RunPod Storage를 활용하여 모델, 커스텀 노드, 작업 결과물을 영구적으로 보관하고 있을 겁니다.

이는 Pods를 종료해도 작업 환경을 유지할 수 있게 해주어 매우 효율적입니다.

 

이제 개발이 완료된 이 워크플로우를 다른 서비스에서 호출할 수 있는 API 형태로 제공해야 합니다.

이를 위해 RunPod의 Serverless Endpoint를 사용하며, 사용자의 API 요청이 들어올 때마다 GPU 컨테이너를 스케일링하여 이미지를 생성하고 결과를 반환하는 방식을 취합니다.

 

문제는 Serverless 컨테이너가 시작될 때마다 필요한 모델과 커스텀 노드를 다시 다운로드해야 한다는 점입니다.

이는 불필요한 시간 소모와 비용을 발생시킵니다.

이 문제를 해결하기 위해, 기존 Pods에서 사용하던 Storage를 Serverless 컨테이너에 마운트하여 사전 다운로드된 자원을 활용할 수 있습니다.

 


RunPod Serverless용 ComfyUI Docker 이미지 커스텀 가이드

RunPod Serverless에 최적화된 ComfyUI API를 배포하려면, 공식 runpod-workers/worker-comfyui 레포지토리를 기반으로 Docker 이미지를 커스텀하는 과정이 필요합니다. 이 과정은 API 로직을 통합하고, 필요한 종속성을 미리 설치하여 배포 시간을 최소화하는 데 중점을 둡니다.

https://github.com/runpod-workers/worker-comfyui

 

GitHub - runpod-workers/worker-comfyui: ComfyUI as a serverless API on RunPod

ComfyUI as a serverless API on RunPod. Contribute to runpod-workers/worker-comfyui development by creating an account on GitHub.

github.com

 

위 레포지토리를 clone 합니다.


커스텀

기존 Dockerfile에 API 로직과 필요한 라이브러리 설치 단계를 추가해야 합니다. 

 

1. requirements-custom-nodes.txt 추가

프로젝트 루트 위치에 워크플로우 로직에 필요한 Python 라이브러리(예: requests, runpod)를 정의하는 의존성 관리 파일을 생성합니다. 

cutom-nodes 는 이미 사전에 작업 과정에서 Storage 에 다운받아져 있지만, 

Serverless 의 오토스케일링에 의해 동적으로 GPU PC 컨테이너가 올라가고 내려갈때마다 새로운 깨끗한 PC환경을 받는 것이나 다름없기 때문에, 의존성 패키지들은 매번 설치를 새로 해두어야 합니다. 

 

아래는 사용하는 워크플로우에 구성된 Custom_node 에 필요한 의존성 패키지들만 모아둔 것이다.

만약 새로운 custom_node 를 워크플로우상에 추가한 경우, 그 custom_node 가 필요로하는 의존성을 이 파일에 새롭게 추가하여 docker 이미지를 새로 배포하면 된다.

# Custom nodes dependencies
# Core dependencies
# opencv-python
gguf
numba
piexif

# Machine learning and scientific computing
# scikit-image
# accelerate

# Utilities
# simpleeval

# Hugging Face compatibility fix
# huggingface_hub

# Additional packages that might be needed by various custom nodes
# (uncomment as needed)
# transformers



# requests
# websocket-client


# pandas

blend_modes
segment_anything
numpy<2
cython
onnxruntime-gpu==1.18.1
insightface==0.7.3

facexlib
ftfy
timm

python-dotenv==1.0.1
boto3==1.34.32

diffusers==0.35.1
peft==0.17.1
lark==1.2.2

2. Dockerfile 수정

runpod-workers/worker-comfyui 레포지토리의 Dockerfile을 수정한다. 

 

# Build argument for base image selection
ARG BASE_IMAGE=nvidia/cuda:12.4.1-cudnn-runtime-ubuntu22.04

# Stage 1: Base image with common dependencies
FROM ${BASE_IMAGE} AS base

# Build arguments for this stage (defaults provided by docker-bake.hcl)
ARG COMFYUI_VERSION=0.3.52
ARG CUDA_VERSION_FOR_COMFY
ARG ENABLE_PYTORCH_UPGRADE
ARG PYTORCH_INDEX_URL=

# Prevents prompts from packages asking for user input during installation
ENV DEBIAN_FRONTEND=noninteractive
# Prefer binary wheels over source distributions for faster pip installations
ENV PIP_PREFER_BINARY=1
# Ensures output from python is printed immediately to the terminal without buffering
ENV PYTHONUNBUFFERED=1
# Speed up some cmake builds
ENV CMAKE_BUILD_PARALLEL_LEVEL=8
ENV PIP_NO_CACHE_DIR=1

# Install Python, git and other necessary tools
RUN apt-get update && apt-get install -y --no-install-recommends \
    build-essential g++ gcc make pkg-config cmake ninja-build \
    python3.11 python3.11-venv python3.11-dev \
    git wget \
    libgl1 libglib2.0-0 libsm6 libxext6 libxrender1 \
    ffmpeg \
    && ln -sf /usr/bin/python3.11 /usr/bin/python \
    && ln -sf /usr/bin/pip3 /usr/bin/pip

# Clean up to reduce image size
RUN apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/*

# Install uv (latest) using official installer and create isolated venv
RUN wget -qO- https://astral.sh/uv/install.sh | sh \
    && ln -s /root/.local/bin/uv /usr/local/bin/uv \
    && ln -s /root/.local/bin/uvx /usr/local/bin/uvx \
    && uv venv /opt/venv

# Use the virtual environment for all subsequent commands
ENV PATH="/opt/venv/bin:${PATH}"

# Install comfy-cli + dependencies needed by it to install ComfyUI
RUN uv pip install comfy-cli pip setuptools wheel \
    && uv pip install "numpy<2" \
    && rm -rf /root/.cache/uv /root/.cache/pip

# Install ComfyUI
RUN /usr/bin/yes | comfy --workspace /comfyui install --version "${COMFYUI_VERSION}" --cuda-version "12.4" --nvidia

# Upgrade PyTorch if needed (for newer CUDA versions)
RUN uv pip install torch==2.4.0 torchvision==0.19.0 torchaudio==2.4.0 --index-url https://download.pytorch.org/whl/cu124

# Change working directory to ComfyUI
WORKDIR /comfyui

# Support for the network volume
ADD src/extra_model_paths.yaml ./

# Go back to the root
WORKDIR /

# Install Python runtime dependencies for the handler
RUN uv pip install runpod requests websocket-client \
    && rm -rf /root/.cache/uv /root/.cache/pip

# Copy and install common dependencies for custom nodes
COPY requirements-custom-nodes.txt /tmp/requirements-custom-nodes.txt
RUN uv pip install -r /tmp/requirements-custom-nodes.txt \
    && rm -rf /root/.cache/uv /root/.cache/pip \
    && find /opt/venv -type d -name '__pycache__' -prune -exec rm -rf {} +

# Add application code and scripts
ADD src/start.sh handler.py test_input.json ./
RUN chmod +x /start.sh

# Prevent pip from asking for confirmation during uninstall steps in custom nodes
ENV PIP_NO_INPUT=1

# Copy helper script to switch Manager network mode at container start
COPY scripts/comfy-manager-set-mode.sh /usr/local/bin/comfy-manager-set-mode
RUN chmod +x /usr/local/bin/comfy-manager-set-mode

# Set the default command to run when starting the container
CMD ["/start.sh"]

# Stage 3: Final image
FROM base AS final

 

 

Dockerfile 의 변경점 분석

기존 comfy-worker 에서 제공하는 Dockerfile 과 무엇이 달라졌는가?

변경된 부분 Custom Dockerfile worker-comfyui Dockerfile
베이스 이미지 nvidia/cuda:12.4.1-cudnn-runtime-ubuntu22.04 nvidia/cuda:12.6.3-cudnn-runtime-ubuntu24.04
Python 버전 python3.11, python3.11-venv python3.12, python3.12-venv
uv 캐시 rm -rf /root/.cache/uv /root/.cache/pip (여러 번 등장) uv pip install 이후 캐시 삭제 명령 없음
PyTorch 업그레이드 uv pip install torch==2.4.0 ... (하드코딩) if [ "$ENABLE_PYTORCH_UPGRADE" = "true" ]; then ... (변수 기반)
커스텀 노드 requirements-custom-nodes.txt 파일을 복사하고 설치 comfy-node-install.sh 스크립트를 복사
모델 다운로드 없음 **downloader**라는 별도 빌드 스테이지에서 모델 다운로드

 

 

Dockerfile 의 변경된 이유 분석

1. 베이스 이미지 및 Python 버전

  • 변경 이유: Runpod 에서 Pods 를 올려서 워크플로우를 테스트 할 때, 사용한 Runpod Pytorch 이미지 버전과 맞추기 위함
  • Runpod Pytorch 2.4.0 : runpod/pytorch:2.4.0-py3.11-cuda12.4.1-devel-ubuntu22.0.4

2. uv 캐시 삭제

  • 변경 이유: Docker 이미지 크기를 최소화하기 위함입니다. uv pip install 명령을 실행할 때마다 생성되는 캐시 파일을 수동으로 삭제하여, 최종 이미지에 불필요한 용량이 포함되지 않도록 합니다. Serverless 환경에서는 이미지 크기가 로딩 시간에 영향을 줄 수 있으므로 중요한 최적화 단계입니다.

3. PyTorch 업그레이드

  • 변경 이유: 원본 Dockerfile은 ENABLE_PYTORCH_UPGRADE라는 빌드 인자를 통해 동적으로 PyTorch 업그레이드 여부를 결정합니다. 반면 커스텀 Dockerfile은 특정 버전(2.4.0)을 명시적으로 설치합니다. 이는 개발 환경과 동일한 PyTorch 버전을 강제하여 **재현성(Reproducibility)**을 확보하고, 워크플로우 실행 중 발생할 수 있는 호환성 문제를 방지하기 위함입니다.

4. 커스텀 노드 설치 방식

  • 변경 이유: 원본 Dockerfile은 comfy-node-install.sh 스크립트를 사용하여 컨테이너 실행 시점에 노드를 설치하는 유연성을 제공합니다. 이는 모든 노드를 이미지에 포함하는 대신, 사용자가 원하는 노드만 동적으로 설치할 수 있게 합니다.
  • 하지만 커스텀 Dockerfile은 requirements-custom-nodes.txt 파일을 빌드 시점에 복사하여 uv pip install로 필요한 패키지를 미리 설치합니다. 이렇게 하면 컨테이너가 시작될 때마다 설치 과정을 거칠 필요 없이 바로 사용 가능하므로 콜드 스타트(Cold Start) 시간을 단축할 수 있습니다.
  • 스토리지를 연결하여 사용하기 때문에, 이미 커스텀 노드관련된 파일들은 다운받아져 있는 상태이고, 필요한 의존성만 설치하면 되어 이렇게 구성했습니다.

5. 모델 다운로드

  • 변경 이유: 가장 큰 차이점입니다. 원본 Dockerfile은 downloader라는 별도 빌드 스테이지를 통해 미리 정의된 모델들을 이미지에 포함시킵니다. 이는 컨테이너가 시작될 때 모델을 다운로드하는 시간을 없애 주어 콜드 스타트 시간을 획기적으로 줄이지만, 이미지 용량이 매우 커진다는 단점이 있습니다.
  • 커스텀 Dockerfile에는 이 downloader 스테이지가 없습니다. 대신, RunPod Storage를 마운트하여 모델을 로드하는 방식을 사용합니다. 이는 다음 두 가지 장점이 있습니다.
    1. 이미지 크기 최적화: 모델 파일이 이미지에 포함되지 않으므로 Docker 이미지 크기를 최소화할 수 있습니다.
    2. 유연성 및 효율성: 모델을 이미지에 굽는 대신, Pods 개발 환경에서 사용하던 동일한 Storage를 Serverless 컨테이너에 마운트하여 사용합니다. 이는 모델 업데이트가 있을 때마다 이미지를 새로 빌드하고 푸시할 필요 없이, Storage의 모델만 교체하면 되므로 매우 효율적입니다.

이처럼 커스텀 Dockerfile은 RunPod Storage를 활용하는 전략을 중심으로, 이미지 크기를 최적화하고 콜드 스타트 시간을 줄이는 데 초점을 맞추고 있습니다.

 


 

3. src/extra_model_paths.yaml

 

스토리지에서 미리 다운받아놓은 모델들의 경로를 Serverless Gpu 컨테이너에 매핑하기 위한 yaml 파일 입니다.

사용하는 모델들 경로를 작성하면 됩니다.

 

runpod_worker_comfy:
  base_path: /runpod-volume/ComfyUI/models
  checkpoints: checkpoints/
  clip: clip/
  clip_vision: clip_vision/
  configs: configs/
  controlnet: controlnet/
  diffusers: diffusers/
  diffusion_models: diffusion_models/
  dreamo: dreamo/
  embeddings: embeddings/
  facexlib: facexlib/
  gligen: gligen/
  hypernetworks: hypernetworks/
  loras: loras/
  photomaker: photomaker/
  pulid: pulid/
  rembg: rembg/
  style_models: style_models/
  text_encoders: text_encoders/
  unet: unet/
  upscale_models: upscale_models/
  vae: vae/
  vae_approx: vae_approx/
  wget-log: wget-log/
  insightface: insightface/

 

여기서 insightface 의 경우, runpod-worker 에서 모델로 인식하지 못하는 이슈가 있습니다.

이로 인해 실제 api 로 pulid 기반 워크플로우를 돌려봤을때, 페이스 디텍트가 제대로 되지 않아서 (insightface 의 역할 : Face detection)  인풋으로 사용한 얼굴의 특징이 반영되지 않은 페이스 스왑 결과물을 받는 이슈가 있었습니다. 

이를 해결하기 위해 아래 Start.sh 에서 추가적인 설명을 합니다.


insightface 를 사용하지 않더라도, 아래 start.sh 수정이 필요합니다. 



4. Start.sh 수정

src/start.sh 을 수정합니다.

 

#!/usr/bin/env bash 

# ─────────────────────────────────────────────────────────────

# Copy all custom_nodes from network volume to local directory
if [ -d "/runpod-volume/ComfyUI/custom_nodes" ]; then
    echo "ls -la /runpod-volume/ComfyUI/custom_nodes"
    ls -la /runpod-volume/ComfyUI/custom_nodes/
    
    # Remove any existing symlinks or directories that might conflict
    rm -rf /comfyui/custom_nodes/custom_nodes
    
    # Copy all custom nodes
    cp -r /runpod-volume/ComfyUI/custom_nodes/* /comfyui/custom_nodes/ 2>/dev/null || echo "worker-comfyui: No files to copy or copy failed"
    
    echo "worker-comfyui: Custom nodes copied successfully"
    echo "ls -la /comfyui/custom_nodes/"
    ls -la /comfyui/custom_nodes/
else
    echo "worker-comfyui: No custom_nodes directory found in Network Volume"
fi


# Check if /runpod-volume/ComfyUI/models/insightface is mounted
if [ -d "/runpod-volume/ComfyUI/models/insightface" ]; then
    echo "/runpod-volume/ComfyUI/models/insightface directory exists." 
    
    # Create a soft link to /comfyui/models/insightface if it doesn't already exist 목적지에 없으면,
    if [ ! -L "/comfyui/models/insightface" ]; then
        ln -s /runpod-volume/ComfyUI/models/insightface /comfyui/models/insightface 
        echo "Created a soft link to /comfyui/models/insightface."
    else
        echo "Soft link already exists."
    fi 
else
    echo "/runpod-volume/ComfyUI/models/insightface directory does not exist."
fi


# Link output directory
echo "worker-comfyui: Linking output directory..."
ln -sf /runpod-volume/ComfyUI/output /comfyui/output

echo "worker-comfyui: Verifying setup..."
echo "/comfyui/custom_nodes/."
ls -la /comfyui/custom_nodes/ || echo "ERROR: /comfyui/custom_nodes directory check failed"
echo "/comfyui/output"
ls -la /comfyui/output || echo "ERROR: /comfyui/output link failed"
# ─────────────────────────────────────────────────────────────

# Use libtcmalloc for better memory management
TCMALLOC="$(ldconfig -p | grep -Po "libtcmalloc.so.\d" | head -n 1)"
export LD_PRELOAD="${TCMALLOC}"

# Ensure ComfyUI-Manager runs in offline network mode inside the container
comfy-manager-set-mode offline || echo "worker-comfyui - Could not set ComfyUI-Manager network_mode" >&2

echo "worker-comfyui: Starting ComfyUI"

# Allow operators to tweak verbosity; default is DEBUG.
: "${COMFY_LOG_LEVEL:=DEBUG}"

# Serve the API and don't shutdown the container
if [ "$SERVE_API_LOCALLY" == "true" ]; then
    python -u /comfyui/main.py --disable-auto-launch --disable-metadata --listen --verbose "${COMFY_LOG_LEVEL}" --log-stdout &

    echo "worker-comfyui: Starting RunPod Handler"
    python -u /handler.py --rp_serve_api --rp_api_host=0.0.0.0
else
    python -u /comfyui/main.py --disable-auto-launch --disable-metadata --verbose "${COMFY_LOG_LEVEL}" --log-stdout &

    echo "worker-comfyui: Starting RunPod Handler"
    python -u /handler.py
fi

 


start.sh 의 변경점 분석

 

두 스크립트의 주요 차이점은 스크립트 상단에 추가된 Storage 관련 파일 및 디렉터리 처리 로직입니다.

변경된 부분 Custom start.sh worker-comfyui start.sh (원본)
커스텀 노드 복사 /runpod-volume/ComfyUI/custom_nodes에서 /comfyui/custom_nodes로 파일을 복사(cp) 관련 스크립트 없음
insightface 모델 링크 /runpod-volume/ComfyUI/models/insightface에 대한 심볼릭 링크(ln -s)를 /comfyui/models/insightface에 생성 관련 스크립트 없음
output 디렉터리 링크 /runpod-volume/ComfyUI/output에 대한 심볼릭 링크(ln -sf)를 /comfyui/output에 생성 관련 스크립트 없음
핵심 실행 로직 기존의 python -u /comfyui/main.py와 python -u /handler.py 실행 로직은 동일 기존의 python -u /comfyui/main.py와 python -u /handler.py 실행 로직은 동일

 

원본 start.sh와 커스텀 start.sh의 가장 큰 차이점은 RunPod Storage 마운트와 관련된 추가적인 스크립트입니다.

커스텀 스크립트는 컨테이너가 시작될 때 Storage에 있는 custom_nodes 자원을 컨테이너 내부로 가져오는 역할을 합니다.
+ # Check if /runpod-volume/ComfyUI/models/insightface is mounted

+ insightface 의 경우에는 모델로 인식하지 못하여 (extra_model_paths.yaml 파일에 매핑이 동작하지 않음) 

+ 추가로 복사를 해주어야 합니다.

 

 

start.sh 의 변경된 이유 분석

이러한 변경은 **"컨테이너가 시작될 때마다 모델과 커스텀 노드를 다운로드하지 않고, 이미 존재하는 RunPod Storage를 활용한다"**는 핵심 전략을 구현하기 위함입니다.

 

 

1. 커스텀 노드 복사

  • 커스텀 노드의 경로를 읽지 못하는 이슈가 있어서 통째로 컨테이너에 복사하는 것으로 수정했다. 

 

2. insightface 모델 심볼릭 링크

 

Configuring insightface model paths with yaml file · Issue #5280 · comfyanonymous/ComfyUI

Expected Behavior Leaving ComfyUI\models\insightface empty, whereas having an external path to the actual localization of the models, via .yaml file: comfyui: base_path: ExternalPath ... pulid: mod...

github.com

 

 

Deploying a ComfyUI Workflow on a Serverless Runpod Worker

An uphill battle with python, comfyui and docker.

www.mikedegeofroy.com

 

 

 

1. 사용한 커스텀 노드

https://github.com/TemryL/ComfyS3

 

GitHub - TemryL/ComfyS3: ComfyS3 seamlessly integrates with Amazon S3 in ComfyUI. This open-source project provides custom nodes

ComfyS3 seamlessly integrates with Amazon S3 in ComfyUI. This open-source project provides custom nodes for effortless loading and saving of images, videos, and checkpoint models directly from S3 b...

github.com

 

 

2. 수동 git clone 방식 사용

/workspace/ComfyUI/custom_nodes 에서 필요한 노드 git clone 해주고

git clone https://github.com/TemryL/ComfyS3.git

 

 

3. 다운받은 ComfyS3 로 이동

cd ComfyS3

 

 

4. ComfyS3 에서 필요한 pip 의존성 설치

pip install -r requirements.txt

 

 

5. 클론 받은 ComfyS3 폴더 안의 .env 를 열어본다

cat .env

 

필요한 키값 기본 세팅이 되어있다

S3_REGION = "replace with your region"
S3_ACCESS_KEY = "replace with your access key"
S3_SECRET_KEY = "replace with your secret key"
S3_BUCKET_NAME = "replace with your bucket name"
S3_INPUT_DIR = "replace with your S3 input dir"
S3_OUTPUT_DIR = "replace with your S3 output dir"

# Optional Enviroment Variables
#S3_ENDPOINT_URL = "replace with your S3 Endoint Url"

 

 

6. 위 파일에 필요한 내용을 입력한다

cat > .env <<EOF
S3_REGION=ap-northeast-2
S3_ACCESS_KEY=AKO...
S3_SECRET_KEY=0jV4N...
S3_BUCKET_NAME=mytest...
S3_INPUT_DIR=input
S3_OUTPUT_DIR=output
EOF

 

 

7. *주의점 ComfyUI 의 Restart 로는 .env 변경사항이 읽히지 않음
나는 Runpod 을 사용하고 있어서 안전하게 아예 Pod을 새로 시작하고

스타트 스크립트부터 새로 시작했음

 

my_start.sh

source /workspace/miniconda3/bin/activate
conda activate comfyui
cd /workspace/ComfyUI

 

 

8. S3 에 업로드된 결과 확인 가능

*** 그런데 메타데이터가 Content-Type : binary/octet-stream 으로 되어있음

 

 

생성된 url 로 바로 접속하면 브라우저에서 이미지를 보여주는 것이 아니라 바로 다운로드를 해버린다

근데 프론트에서 <img> 태그에 src 에 해당 url 을 세팅하는 경우, 
정상적으로 이미지를 잘 로드함

(딱히 문제될건 없어보임)

 

import Image from "next/image";

export default function S3ImageContainer() {
  return (
    <div>
      <div>S3 Image Test</div>
      <Image
        alt="S3 Image"
        className="h-full w-full object-cover"
        width={500}
        height={500}
        src="https://mybucket.s3.ap-northeast-2.amazonaws.com/output/Image_00001_.png"
        />
    </div>
  );
}

 

최근 이미지 생성 워크플로우 자동화를 위해 ComfyUI를 로컬 환경에서 테스트해봤습니다.
이번 포스팅에서는 GPU를 사용하지 않는 모드로, MacBook Pro 16 (RAM 32GB) 환경에서 실행한 과정을 정리합니다.

 

1. 환경 및 사전 조건

  • MacBook Pro 16 (32GB RAM)
  • Docker 설치 및 실행 상태
  • GPU 미사용 (CPU-only)
  • Python 3.10-slim 기반 Docker 이미지 사용

 

2. Dockerfile 구성

GPU를 사용하지 않기 때문에 가벼운 Python 베이스 이미지를 선택했습니다.

dockerfile
# 가벼운 Python 베이스 이미지 사용
FROM python:3.10-slim

# OS 패키지 설치
# git, wget, libgomp1 외에 libgl1-mesa-glx, libglib2.0-0 패키지를 추가로 설치합니다.
RUN apt-get update && apt-get install -y git wget libgomp1 libgl1-mesa-glx libglib2.0-0


# ComfyUI 설치
RUN git clone https://github.com/comfyanonymous/ComfyUI.git
WORKDIR /ComfyUI

# Custom Nodes 미리 다운로드
RUN git clone https://github.com/chflame163/ComfyUI_LayerStyle.git custom_nodes/ComfyUI_LayerStyle
RUN git clone https://github.com/jags111/efficiency-nodes-comfyui.git custom_nodes/efficiency-nodes-comfyui
RUN git clone https://github.com/cubiq/ComfyUI_essentials.git custom_nodes/ComfyUI_essentials

# Custom Nodes 의존성 설치
# ComfyUI_LayerStyle의 의존성 설치
RUN pip install -r custom_nodes/ComfyUI_LayerStyle/requirements.txt
# efficiency-nodes-comfyui의 의존성 설치
RUN pip install -r custom_nodes/efficiency-nodes-comfyui/requirements.txt
# ComfyUI_essentials의 의존성 설치
RUN pip install -r custom_nodes/ComfyUI_essentials/requirements.txt

# CPU 전용 PyTorch 및 기타 라이브러리 설치
RUN pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
RUN pip install -r requirements.txt

# ComfyUI 서버를 시작하는 명령어를 추가
CMD ["python", "main.py", "--listen", "0.0.0.0", "--cpu"]

 

📌 포인트

  • GPU 의존성이 없으니 nvidia-docker 설정이 필요 없습니다.
  • 필요한 커스텀 노드는 Dockerfile에서 바로 클론해두면 편합니다.
  • 모델 로딩이 필요하다면 빌드 시 포함해야 합니다.

 

 

3. 실행 순서

 

1. Docker 이미지 빌드

docker build -t comfyui-local .

 

2. 컨테이너 실행

docker run -p 8188:8188 comfyui-local

 

3. 브라우저 접속

http://localhost:8188/

 

ComfyUI 화면이 뜨면 준비 완료!
이제 필요한 워크플로우를 로드하고 실행할 수 있습니다.

 

 

4. API 호출 테스트 (Postman)

Postman으로 API 호출 테스트했습니다.
ComfyUI는 이미지 업로드, 워크플로우 실행, 결과 조회를 모두 HTTP API로 지원합니다.

 

(1) 이미지 업로드

엔드포인트 : POST http://localhost:8188/upload/image

 

응답 예시

{
  "name": "shadow.png",
  "subfolder": "",
  "type": "input"
}

➡️ name과 subfolder 값은 다음 요청에서 사용됩니다.

 

 

(2) 워크플로우 실행

엔드포인트 : POST http://localhost:8188/prompt

 

Body (raw, JSON)
워크플로우를 API 형식으로 Export한 JSON 데이터를 prompt 키에 넣습니다.

{
  "prompt": { ... }
}

 

응답예시

{
  "prompt_id": "faa09324-4740-4b58-86f8-bfc45318607a",
  "number": 4,
  "node_errors": {}
}

➡️ prompt_id로 실행 상태와 결과를 조회합니다.

 

(3) 실행 결과 조회

엔드포인트 : GET http://localhost:8188/history/faa09324-4740-4b58-86f8-bfc45318607a

응답예시 (일부)

{
  "outputs": {
    "12": {
      "images": [
        {
          "filename": "ComfyUI_00003_.png",
          "subfolder": "",
          "type": "output"
        }
      ]
    }
  },
  "status": {
    "status_str": "success",
    "completed": true
  }
}

 

 

(4) 최종 결과 이미지 확인

출력 파일명을 사용해 브라우저로 직접 확인할 수 있습니다.

http://localhost:8188/view?filename=ComfyUI_00003_.png&type=output&subfolder=

 

5. 마무리

이번 테스트에서 느낀 점:

  • Docker로 실행하면 환경 격리가 쉬워 관리가 편함
  • API 연동을 통해 자동화 파이프라인 구성 가능

다만, 대규모 모델을 사용하거나 고해상도 이미지 작업은 CPU만으로는 시간이 오래 걸리니
본격적인 프로덕션 환경에서는 GPU 서버가 필요합니다.

PuLID 가 포함된 워크플로우 실행시 발생했던 에러 해결한 내용 정리

 

 

1. PuLID 로드하는 부분 Load InsightFace 노드에서 에러 발생

 

 

 

2. 에러 내용

ComfyUI 상에서는 보여지는 에러 

PulidFluxInsightFaceLoader Issue

 

터미널 확인 로그

Requested to load FluxClipModel_
loaded completely 18549.239142227172 9320.35595703125 True
!!! Exception during processing !!! 
Traceback (most recent call last):
  File "/workspace/ComfyUI/execution.py", line 496, in execute
    output_data, output_ui, has_subgraph, has_pending_tasks = await get_output_data(prompt_id, unique_id, obj, input_data_all, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb, hidden_inputs=hidden_inputs)
                                                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/workspace/ComfyUI/execution.py", line 315, in get_output_data
    return_values = await _async_map_node_over_list(prompt_id, unique_id, obj, input_data_all, obj.FUNCTION, allow_interrupt=True, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb, hidden_inputs=hidden_inputs)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/workspace/ComfyUI/execution.py", line 289, in _async_map_node_over_list
    await process_inputs(input_dict, i)
  File "/workspace/ComfyUI/execution.py", line 277, in process_inputs
    result = f(**inputs)
             ^^^^^^^^^^^
  File "/workspace/ComfyUI/custom_nodes/ComfyUI-PuLID-Flux-Enhanced/pulidflux.py", line 281, in load_insightface
    model = FaceAnalysis(name="antelopev2", root=INSIGHTFACE_DIR, providers=[provider + 'ExecutionProvider',]) # alternative to buffalo_l
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/workspace/miniconda3/envs/comfyui/lib/python3.11/site-packages/insightface/app/face_analysis.py", line 43, in __init__
    assert 'detection' in self.models
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError

Prompt executed in 60.93 seconds

Restarting... [Legacy Mode]

 

 

 

3. 해결 방안

동일 이슈 링크

 

언급된 폴더 내부에 들어가서 확인해보니, 언급된 내용대로, antelopev2 안에 한번 더 antelopev2 폴더가 있고, 그 안에 onnx 파일들이 있었다.

 

이 5개의 onnx 파일을 모두 밖으로 이동 시키니 해결!

 

+ Recent posts