Nodes/Comfyui-Save_To_OneDrive/Save Image to OneDrive (Creepybits)
ComfyUI Node

Save Image to OneDrive (Creepybits)

Drive

By Creepybits·Created about a year ago·Updated 3 days ago· 3
Save Image to OneDrive (Creepybits)
  • images
  • status_message
◄filename_prefixComfyUI►
◄onedrive_folder_pathComfyUI_Uploads►
◄file_formatPNG►
◄quality90►

Everybody's output folder is a landfill. You queue two hundred images overnight, the SSD fills up, and the good ones are buried in a folder named ComfyUI_00347_. This node breaks that habit: it's a save node that pushes each finished image into a folder in your OneDrive instead of (well, alongside) your disk - a real cloud folder you can browse from your phone, share with a client, or open on a second machine.

What it actually does

It's not a OneDrive client and it isn't magic - it's Microsoft Graph with an OAuth token. On first use it reads your Azure app's client ID, kicks off an MSAL device flow, and prints a link and a code into the ComfyUI console. You open the link, type the code, sign in, and the node picks up where it left off mid-run. The token lands in onedrive_msal_token_cache.bin next to the node's Python file, so you only do that dance once.

Then, per image: it converts the tensor to a PIL image, writes a temporary local copy into ComfyUI's own temp directory, reads the bytes back, and PUTs them to

https://graph.microsoft.com/v1.0/me/drive/root:/<folder>/<file>:/[email protected]=rename

That conflictBehavior=rename is worth knowing about, because it means this node never overwrites anything. If the name is taken, OneDrive quietly renames the new file.

The inputs that matter

You set four things and ignore the rest.

images is the wire in, same IMAGE tensor as any save node. filename_prefix defaults to ComfyUI and gets a five-digit counter appended - IMG_00001.png, IMG_00002.png. onedrive_folder_path defaults to ComfyUI_Uploads and accepts Root/sub/folder; the folders get created if they don't exist. file_format is PNG, JPEG or WEBP.

quality (1–100) is the one field with a catch: it only does anything for JPEG and WEBP. The source hardcodes compress_level=4 for PNG and ignores the slider entirely. So if you're on PNG - and you probably should be - that number is decorative.

The single output is status_message, a STRING joining every file's result with |, success lines including the OneDrive webUrl. You'll rarely wire it anywhere - watch the console, or feed a text preview when debugging. It's a log line, not a handle you can fetch from later.

Install

ComfyUI Manager is the sane route: Manager → Install Custom Nodes → search "Comfyui-Save_To_OneDrive" (or "Save Image to OneDrive") → install → restart. Manager ships with ComfyUI now, so you almost certainly already have it.

Manual is two commands:

cd ComfyUI/custom_nodes
git clone https://github.com/Creepybits/ComfyUI-Save_To_OneDrive
cd ComfyUI-Save_To_OneDrive && pip install -r requirements.txt

The dependencies are light - msal, requests, Pillow, numpy, no models, no compiled anything.

Then you need an Azure client ID. Register an app in the Azure portal (free, personal Microsoft accounts work - the authority is the consumers tenant), grab the Application (client) ID, and either drop it in a file:

{"client_id": "your-application-client-id"}

at custom_nodes/ComfyUI-Save_To_OneDrive/onedrive_config.json, or export ONEDRIVE_CLIENT_ID. The README points at a Patreon walkthrough for the Azure side; you don't need it - a free app registration plus the device-flow prompt the node prints is enough. Both the config file and the token cache are gitignored, for good reason.

Where people get burned

Bad auth doesn't fail the prompt. No client ID, or a token it can't acquire, and the node returns an error string as its status_message while the queue goes green. Nothing turns red. If images aren't showing up, read that text and the console before reinstalling anything.

The counter resets when ComfyUI restarts. It's an in-memory dict, so a fresh session starts at _00001 again - and because of that rename conflict behaviour, you get IMG_00001 1.png and friends rather than overwrites. Fine, but your folder gets messy fast. Change the prefix per project.

JPEG and WEBP throw away the workflow. This is the big one. PNG output embeds prompt and extra_pnginfo - the full graph - so a PNG you pull back off OneDrive still drags into the canvas as an editable workflow. JPEG and WEBP have no PNG text chunks; that export is a picture, not a project file. If the point is moving work between machines, stay on PNG.

It's a credential holder. The token cache is a refresh token on disk, and a node that calls the network by design is exactly the shape of pack that's been weaponized in this ecosystem before. You're trusting the author here. Don't hand your custom_nodes folder around or commit it anywhere.

Big batches crawl. Uploads run inside the queue, so a 50-image batch on a slow uplink sits there with the workflow "running". Save locally and sync afterwards if you're dumping volume.

Worth it?

For anyone generating on a remote pod, or who just wants the keeper folder reachable from another device without a sync client, yes - it's small, readable, and doesn't drag in a cloud SDK. If you already have a sync tool pointed at output, it's a redundant hop. And use PNG.

CategoryCreepybits/Cloud

Inputs (5)

NameTypeDefaultDescription
imagesIMAGE—
filename_prefixSTRINGComfyUI—
onedrive_folder_pathSTRINGComfyUI_Uploads—
file_formatCOMBOPNG3 options: PNG, JPEG, WEBP
qualityINT901–100—

Outputs (1)

NameTypeDescription
status_messageSTRING—