Skip to content

Latest commit

 

History

History
101 lines (71 loc) · 3.95 KB

File metadata and controls

101 lines (71 loc) · 3.95 KB

Tutorial: Install and use the "Post to Mastodon" node

This walks through installing the node directly from InvokeAI's UI and posting an image to Mastodon from a workflow graph, in dry-run mode. Every screenshot below was captured live from a real install and a real run — none of these are mockups.

1. Open the Custom Node Manager

In InvokeAI, click Nodes in the left sidebar. Before installing anything, this page shows no custom node packs:

No custom node packs installed

2. Paste the repository URL

Under Install Node Pack → Git Repository URL, paste this repo's URL:

https://github.com/Vitexus/invokeai-mastodon-node

Repository URL filled in

Click Install.

3. Confirm the install

InvokeAI clones the repository into its nodes/ folder and loads it immediately — no restart needed. The Install Log shows COMPLETED, and the node pack now appears in the list on the left (invokeai-mastodon-node, 1 node, POST_TO_MASTODON):

Install completed successfully

4. Find the node in the Workflow Editor

Switch to the Workflow Editor tab, click + to add a node, and search "mastodon". Post to Mastodon appears under a dedicated Mastodon category, tagged with this pack's name:

Searching for the node

Click it to place it on the canvas. It has three inputs — Image, Service Url (defaults to http://127.0.0.1:8765), and Dry Run — and one Value output:

Node placed on the canvas

5. Start the bridge service

The node itself has no dependencies and does nothing on its own — it calls a small local HTTP bridge that does the real work (NSFW check, caption generation, Mastodon upload). Start it from the invokeai-mastodon project (see that repo's README for first-time setup — Mastodon token, Ollama, etc.):

invokeai-mastodon serve --config config.toml --port 8765

Leave it running in a terminal while you use the node.

6. Wire up an image and enable Dry Run

Drop an image onto the Image field (drag one from the gallery, or connect it from an upstream node such as l2i), and toggle Dry Run on while you're testing — this runs the full pipeline (NSFW classification, caption generation) without actually posting anything to Mastodon:

Image wired in with Dry Run enabled

7. Run it

Click Invoke. Once it completes, open the node's Outputs tab to see the result. This is a real run against a real image — the classifier scored it and correctly found it not sensitive:

Real output: dry-run result showing the NSFW classification

Turn off Dry Run and run it again to actually publish the post. The output then becomes the live Mastodon status URL, or an error message if something went wrong (e.g. the bridge service isn't running, or Mastodon rejected the request) — the image is never marked as posted in the bridge's local state unless Mastodon actually confirmed the post succeeded.

Troubleshooting

  • "Could not reach invokeai-mastodon bridge..." — the invokeai-mastodon serve process isn't running, or is on a different port than the node's Service Url.
  • Node doesn't appear after install — check InvokeAI's log for Loaded 1 node pack from <root>/nodes: invokeai-mastodon-node; if it's missing, restart InvokeAI once (installs via the UI load immediately, but a manual git clone into the nodes/ folder needs a restart).
  • Everything is marked sensitive — this is the intentional fail-safe: if the NSFW classifier (opennsfw2) isn't installed or fails for any reason, the bridge always defaults to sensitive rather than risk posting unflagged NSFW content. See the invokeai-mastodon README for installing the real classifier.