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 인라인 스타일로 수정

 

 

 

 

 

 

 

 

 

 

+ Recent posts