Nodes/ComfyUI-SocialMediaExport/Social Media Export
ComfyUI Node

Social Media Export

One image, every platform, minimum crop

By 0xBeycan·Created about a month ago·Updated 29 days ago· 0
Social Media Export
  • images
  • images
  • report
instagram_feedtrue
instagram_storytrue
x_timelinefalse
tiktok_photofalse
tiktok_verticalfalse
pinterest_pinfalse
facebook_feedfalse
facebook_storyfalse
threads_feedfalse
blueskyfalse
redditfalse
resize_modecrop
quality92
allow_upscalefalse
filename_prefixsocial/export

Here's the annoying thing that happens every time you post AI art to a social platform: you render a glorious 3840×2160 master, you upload it, and the site quietly destroys it. It re-encodes, downscales, crops to some arbitrary frame, and flattens your gradients into banding - all because your file didn't match what the platform expected. Social Media Export is a ComfyUI output node built to stop that. You give it your finished master, tick the platforms you're posting to, and it writes one clean, platform-shaped derivative per site, so the platform has nothing left to "fix."

What it is (and what it isn't)

This is a parallel export node, not a replacement for your save node. Wire your master image into both: your usual Save Image keeps the archival file with the full ComfyUI workflow metadata baked in, and Social Media Export produces the third-party-facing copies. It does no generation, no upscaling, no enhancement, and no posting - the contract is files on disk under ComfyUI/output/social/.

The differentiator from older "social preset" nodes is the aspect-ratio philosophy. Most preset nodes force a fixed W×H, which crops far more than necessary. Platforms actually accept a range of aspect ratios inside a pixel envelope, so this node treats each platform as an aspect-ratio band: if your master already falls inside the band, zero crop, just scaling. If it doesn't, it crops the minimum possible amount on a single axis to reach the nearest band edge. A 16:9 landscape heading to an Instagram story gets trimmed just enough to reach 9:16 - no more.

The inputs that matter

  • Per-platform checkboxes - instagram_feed, instagram_story, x_timeline, tiktok_photo, tiktok_vertical, pinterest_pin, facebook_feed, facebook_story, threads_feed, bluesky, reddit. Instagram's two are on by default; everything else is off until you tick it. Each tooltip shows that platform's band, dims, and format.
  • resize_mode (crop default | pad) - the one real decision. crop trims the minimum edge to fill the frame, no bars. pad keeps every pixel and fills the rest with a blurred, cover-scaled copy of the image itself (soft bars, never flat black). Either way, the platform gets a shape it won't re-crop.
  • quality (default 92) - visually lossless; lower it only if you need smaller files.
  • allow_upscale (default off) - enlarges small images toward the platform's recommended size. Leave it off unless your source is genuinely tiny.
  • filename_prefix (default social/export) - standard ComfyUI prefix; one file per platform, e.g. social/export_instagram_story_00001_.jpg.

Two outputs: images is your input passed through untouched (chain it onward), and report is a text line per (image, platform) showing input → crop → output dims, crop percentage, strategy, final quality, and file size. When a file misses, that's where you look.

The encode is the point

Behind the scenes it's deliberately fussy in ways that read as smart: 4:4:4 chroma (Pillow defaults to 4:2:0 at every quality level unless you pass subsampling=0), progressive JPEG, a small sRGB ICC profile embedded, LANCZOS resampling, and metadata stripped - no workflow JSON or prompt EXIF leaks into the third-party copy. The provenance stays in your master. If a platform sets a byte cap (Instagram's 8 MB, Bluesky's 1,000,000 B), quality auto-steps down in increments of 5 to fit, floor 70, and flags the line if it still can't.

Install

Pillow is the only dependency, and it ships with ComfyUI. Either use ComfyUI Manager (search "SocialMediaExport") or:

cd ComfyUI/custom_nodes
git clone https://github.com/0xBeycan/ComfyUI-SocialMediaExport

Restart ComfyUI and it appears as Social Media Export under image/social. The platform specs live in social_specs.json, re-read on every execution - edit a value and the next run picks it up, no restart.

Gotchas

Ticking no platform makes the node raise immediately - it needs at least one. And don't be surprised that your exports have no embedded workflow: that's intentional, so keep the master saved separately if you care about reproducibility. Finally, some spec numbers (X/TikTok dims, Bluesky/Reddit geometry) are best estimates rather than verified from official docs - the README's verification table says which, honestly, so double-check if a platform ever misbehaves.

Categoryimage/social

Inputs (16)

NameTypeDefaultDescription
imagesIMAGE
instagram_feedBOOLEANtrueInstagram Feed — 0.8–1.91 aspect (w/h), up to 1440×1800px, JPG.
instagram_storyBOOLEANtrueInstagram Story — fixed 0.5625 aspect (w/h), up to 1080×1920px, JPG.
x_timelineBOOLEANfalseX Timeline — 0.75–2 aspect (w/h), up to 2048×2048px, JPG.
tiktok_photoBOOLEANfalseTiktok Photo — 0.4545–2.2 aspect (w/h), up to 1080×1920px, JPG.
tiktok_verticalBOOLEANfalseTiktok Vertical — fixed 0.5625 aspect (w/h), up to 1080×1920px, JPG.
pinterest_pinBOOLEANfalsePinterest Pin — 0.476–0.6667 aspect (w/h), up to 1000×1500px, JPG.
facebook_feedBOOLEANfalseFacebook Feed — 0.8–1.91 aspect (w/h), up to 1440×1800px, JPG.
facebook_storyBOOLEANfalseFacebook Story — fixed 0.5625 aspect (w/h), up to 1080×1920px, JPG.
threads_feedBOOLEANfalseThreads Feed — 0.01–10 aspect (w/h), up to 1080×1920px, JPG.
blueskyBOOLEANfalseBluesky — 0.5–2 aspect (w/h), up to 2000×2000px, JPG.
redditBOOLEANfalseReddit — 0.5–1.91 aspect (w/h), up to 1200×1600px, JPG.
resize_modeCOMBOcropHow to reach each platform's shape when your image doesn't fit: • crop — trim the edges to fill the frame (no bars; may cut a little off) • pad — keep the whole image, filling the rest with a blurred copy (nothing is cut; adds soft bars). Either way the platform gets an image it won't re-crop.
qualityINT921–100JPEG/WebP quality. 92 is visually lossless; lower it only if you need smaller files. (If a platform has a byte cap, quality auto-steps down.)
allow_upscaleBOOLEANfalseEnlarge small images up to the platform's recommended size. Off = never upscale (safest quality).
filename_prefixSTRINGsocial/exportOutput name prefix. One file per selected platform is written under ComfyUI/output (e.g. social/export_instagram_story_00001_.jpg).

Outputs (2)

NameTypeDescription
imagesIMAGE
reportSTRING