Nodes/ComfyUI-Thread/Publish Thread
ComfyUI Node

Publish Thread

Post Your Generations Straight to Threads — No 'Save Then Upload'

By dseditor·Created about a year ago·Updated about a year ago· 7
Publish Thread
  • image
  • result
text
ComfyUIHttpsURL
image_url

PublishThread is the main event of the ComfyUI-Thread pack: it takes whatever your graph just generated and posts it to Threads, with text. The workflow becomes generate → post instead of generate → save → open browser → upload, which is the whole point of wiring social media into ComfyUI in the first place. It handles the three cases you'll actually want - a text-only post, a single image, and a multi-image carousel - and it takes an IMAGE tensor straight off a VAE decode, so your finished generations never touch disk until they're being published.

How it works

Every node in this pack reads token/thread_config.json, so StartWithLongLiveToken still has to run first. Then it collects image URLs from two places: the image tensor input (saved to ComfyUI's output folder as thread_image_<timestamp>.png, with a URL built from your base URL) and the image_url field (external URLs, one per line). From there the logic is simple:

  • no images → text-only post
  • one image → single IMAGE media container with your text
  • two or more → a carousel: each image becomes a carousel item, then a CAROUSEL container bundles them, then it's published

Either way you get back a result string with the post URL (https://www.threads.net/@username/post/...), which you'll want to wire into a ShowText node.

The inputs that matter

  • text (required) - the post content. Multi-line.
  • image - an IMAGE tensor from any generator in your graph.
  • image_url - external image URLs, one per line. This is your workaround when the public-URL setup below isn't working.
  • ComfyUIHttpsURL - optional, and here's where beginners get burned.

The catch: Threads has to be able to fetch your image

Here's the thing the README is upfront about and most people discover the hard way: Threads' servers pull the image from a URL you give them. If your ComfyUI is running on 127.0.0.1:8188, that URL is meaningless to Meta - the post goes through, but the image doesn't display and you're left with a text-only post you didn't mean to make.

Fix: set ComfyUIHttpsURL to a public HTTPS URL for your ComfyUI - ngrok is the README's own recommendation. It's remembered in token/url.json once you set it, so you only re-enter it when the URL changes. If you don't want to expose your machine at all, image_url with a public URL (an image host, a bucket, anywhere HTTPS) sidesteps the whole tunnel dance.

That exposure comes with a real security caveat, and it's not academic: ComfyUI's API is unauthenticated by default, so anyone who reaches your ngrok URL can execute arbitrary workflows on your machine. The community learned this the hard way. If you tunnel, understand that you're opening your instance to the internet, and prefer a throwaway instance over your main one.

Install

ComfyUI Manager → search ComfyUI-Thread → install → restart, or:

cd ComfyUI/custom_nodes/
git clone https://github.com/dseditor/ComfyUI-Thread

No models to download. The only listed dependency is threads_sdk, which the code doesn't even import - it talks to the Graph API directly. Installing is fast and painless.

Gotchas

  • Batch images are fine, ImageLists are not. The README notes the image input supports ImageBatch/BatchSize - if you have an ImageList, batch it up first (MakeImageBatch) before connecting.
  • "Param image_url is not a valid URL" - check that every line starts with https:// (or http://) and is actually reachable.
  • Post succeeded but no image showed up - 99% of the time this is the base URL still being localhost. Check ComfyUIHttpsURL.
  • Carousels need 2+ images - one image is a single-image post, which is fine, just know the rule.
  • If this pack feels too bare-bones for you (no image-hosting keys, no temp server management), the README itself points to ComfyUI Threads Uploader as the more full-featured sibling. This one is deliberately minimal.
CategoryComfyUI-Thread

Inputs (4)

NameTypeDefaultDescription
textSTRING
ComfyUIHttpsURLoptSTRING
imageoptIMAGE
image_urloptSTRING

Outputs (1)

NameTypeDescription
resultSTRING