An InvokeAI custom Invocation node, "Post to Mastodon", that appears in the Workflow Editor and lets you publish a generated image to Mastodon directly from a workflow graph.
This node has zero third-party dependencies. It only makes a plain HTTP
POST (stdlib urllib) to a small local bridge service — the actual posting
logic (NSFW detection, caption/hashtag generation, Mastodon upload) lives in
the companion project, invokeai-mastodon,
which you run separately as invokeai-mastodon serve. This split keeps
InvokeAI's own Python environment untouched — no TensorFlow, no Mastodon.py,
nothing installed alongside InvokeAI's pinned dependencies.
Full step-by-step tutorial with screenshots: docs/tutorial.md
In InvokeAI's UI: Nodes → Custom Nodes → Install Node Pack → Git Repository URL, paste:
https://github.com/Vitexus/invokeai-mastodon-node
Or manually:
git clone https://github.com/Vitexus/invokeai-mastodon-node <INVOKEAI_ROOT>/nodes/invokeai-mastodon-nodeRestart InvokeAI. Its log should show
Loaded 1 node pack from <root>/nodes: invokeai-mastodon-node.
-
Start the bridge service (see the invokeai-mastodon README for full setup, including Mastodon credentials and NSFW/caption config):
invokeai-mastodon serve --config config.toml --port 8765
It binds to
127.0.0.1only by default — it has no authentication, so never expose it beyond localhost. -
In InvokeAI's Workflow Editor, add a node and search "mastodon" — Post to Mastodon appears under the Mastodon category. Wire an image into its
Imageinput, leaveService Urlat the default unless you changed the bridge's port, and toggleDry Runfor testing without actually posting. -
Run the graph. The node's output is a status string (or the resulting Mastodon post URL), visible in the node's Outputs panel.
MIT