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 요청이 완료되어 이미지가 저장되고, 웹훅을 받은 것 확인

 

 

+ Recent posts