Social Media Export
One image, every platform, minimum crop
- images
- images
- report
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(cropdefault |pad) - the one real decision.croptrims the minimum edge to fill the frame, no bars.padkeeps 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(defaultsocial/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.
Inputs (16)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | — | |
| instagram_feed | BOOLEAN | true | Instagram Feed — 0.8–1.91 aspect (w/h), up to 1440×1800px, JPG. |
| instagram_story | BOOLEAN | true | Instagram Story — fixed 0.5625 aspect (w/h), up to 1080×1920px, JPG. |
| x_timeline | BOOLEAN | false | X Timeline — 0.75–2 aspect (w/h), up to 2048×2048px, JPG. |
| tiktok_photo | BOOLEAN | false | Tiktok Photo — 0.4545–2.2 aspect (w/h), up to 1080×1920px, JPG. |
| tiktok_vertical | BOOLEAN | false | Tiktok Vertical — fixed 0.5625 aspect (w/h), up to 1080×1920px, JPG. |
| pinterest_pin | BOOLEAN | false | Pinterest Pin — 0.476–0.6667 aspect (w/h), up to 1000×1500px, JPG. |
| facebook_feed | BOOLEAN | false | Facebook Feed — 0.8–1.91 aspect (w/h), up to 1440×1800px, JPG. |
| facebook_story | BOOLEAN | false | Facebook Story — fixed 0.5625 aspect (w/h), up to 1080×1920px, JPG. |
| threads_feed | BOOLEAN | false | Threads Feed — 0.01–10 aspect (w/h), up to 1080×1920px, JPG. |
| bluesky | BOOLEAN | false | Bluesky — 0.5–2 aspect (w/h), up to 2000×2000px, JPG. |
| BOOLEAN | false | Reddit — 0.5–1.91 aspect (w/h), up to 1200×1600px, JPG. | |
| resize_mode | COMBO | crop | How 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. |
| quality | INT | 921–100 | JPEG/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_upscale | BOOLEAN | false | Enlarge small images up to the platform's recommended size. Off = never upscale (safest quality). |
| filename_prefix | STRING | social/export | Output name prefix. One file per selected platform is written under ComfyUI/output (e.g. social/export_instagram_story_00001_.jpg). |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| images | IMAGE | — |
| report | STRING | — |