Nodes/AQnodes for ComfyUI/AQ_YouTubeUpload
ComfyUI Node

AQ_YouTubeUpload

Upload a finished mp4 to YouTube straight from the ComfyUI graph

By 2frames·Created about a year ago·Updated 6 months ago· 1
AQ_YouTubeUpload
    • video_url
    • video_id
    • instruction
    video_path
    client_id
    client_secret
    refresh_token
    titleMy Song
    privacy_statusprivate
    description
    tagline
    headline
    tags
    keyscaleC major

    End of the pipeline. If AQ_StillImageToVideo turns a cover image and an audio track into an mp4, AQ_YouTubeUpload is the node that takes that mp4 and publishes it - category set to Music, title applied, privacy level chosen, straight from the graph. It's the final step of an automated song-cover machine, and it's a genuinely unusual thing to have inside ComfyUI: most people upload videos by hand; this node just does the whole YouTube API dance for you.

    The setup is the real cost of entry. YouTube doesn't accept a plain API key for uploads - it needs OAuth 2.0, which means three credentials: a client ID, a client secret, and a refresh token. You generate those once per channel, in the Google Cloud console, and paste them into the node. The good news: the node itself is the documentation. Its instruction output is a full step-by-step guide for creating a Google Cloud project, enabling the YouTube Data API v3, setting up the OAuth consent screen, creating a "Web application" OAuth client, and minting a refresh token via the OAuth Playground.

    How it works

    Source-grounded, it's a standard OAuth + resumable upload:

    1. POSTs your client_id/client_secret/refresh_token to Google's token endpoint to get a short-lived access token,
    2. starts a resumable upload session with the video metadata (title, description, tags, categoryId 10 for Music, your chosen privacy_status),
    3. streams the file up in 10 MB chunks, resuming on 308 responses until it gets a video ID.

    If you leave description empty, it auto-composes one from your tagline, tags, keyscale, and headline inputs - including embedding the musical key as Key: <keyscale>, which fits this pack's whole song-cover vibe. If any of the three credentials is blank, the node refuses to run and hands you the instruction guide instead.

    The inputs that matter

    • video_path - the mp4 to upload. Wire in the video_path output from AQ_StillImageToVideo, or type a path.
    • client_id, client_secret, refresh_token - the OAuth trio. All three required.
    • title - defaults to "My Song". Change it.
    • privacy_status - private (default), unlisted, or public. Keep it private while you test; flipping to public is a one-line change once you trust the pipeline.

    Optional: description (multiline, auto-built if left empty), plus tagline, headline, tags (comma-separated), and keyscale (the same 34-option musical-key dropdown from the video node).

    Outputs

    Three STRING outputs: video_url (https://www.youtube.com/watch?v=<id>), video_id, and instruction - that giant OAuth setup guide again. It's not an error; it's the node shipping its own manual as a port. You only actually read it once, but it's there whenever the upload fails.

    Installing

    Pack-level install, same as the rest:

    cd ComfyUI/custom_nodes
    git clone https://github.com/2frames/ComfyUI-AQnodes
    

    restart, or use ComfyUI Manager and search "AQnodes". This node's only dependency is requests, which ComfyUI already has. The real "dependency" is your Google Cloud credentials.

    Troubleshooting (straight from the node's own error hints)

    • unauthorized_client - two common causes. Either you created a Desktop app OAuth client instead of a Web application one (the Playground needs a web redirect URI), or you authorized the API in the OAuth Playground before pasting your own credentials into its gear icon, so the token belongs to Google's own client. Recreate the client as Web application with redirect URI https://developers.google.com/oauthplayground, then redo the token step.
    • access_denied / 403 during upload - the Google account uploading isn't listed as a Test User on the OAuth consent screen. Add it, redo the authorization.
    • invalid_grant - the refresh token was revoked or the authorization removed. Regenerate from the token step.
    • Missing file - if video_path doesn't exist, the node raises FileNotFoundError. Feed it a real path.

    One housekeeping note: this node stores your client secret and refresh token in the workflow JSON in plain text. That's fine for a private local setup; it's a credential sitting in your graph, so don't go pasting the workflow into public share sites with real tokens in it.

    CategoryAquasite/Media

    Inputs (11)

    NameTypeDefaultDescription
    video_pathSTRING
    client_idSTRING
    client_secretSTRING
    refresh_tokenSTRING
    titleSTRINGMy Song
    privacy_statusCOMBOprivate3 options: private, unlisted, public
    descriptionoptSTRING
    taglineoptSTRING
    headlineoptSTRING
    tagsoptSTRING
    keyscaleoptCOMBOC major34 options: C major, C# major, Db major, D major, D# major, Eb major, +28

    Outputs (3)

    NameTypeDescription
    video_urlSTRING
    video_idSTRING
    instructionSTRING