Automatic1111 Node icon

Automatic1111 Node

Automatic1111 Node

Overview

This node integrates with an Automatic1111 Stable Diffusion web UI API to generate images from text prompts. It allows users to specify various parameters such as the model, sampler method, prompt, image dimensions, and other generation settings. The node sends requests to the API to produce images based on these inputs and returns the generated images as binary data.

Common scenarios:

  • Creating AI-generated artwork or concept images from descriptive text prompts.
  • Automating batch image generation workflows with different styles or models.
  • Enhancing creative projects by programmatically generating visuals using Stable Diffusion.

Practical example:
A user wants to generate a batch of 3 images depicting a "celestial nebula" scene with specific lighting and style. They select a particular model checkpoint, choose a sampler method, set the prompt and negative prompt to avoid unwanted elements, define image size (e.g., 512x512), and configure steps and scale for quality. The node then produces the images and outputs them for further use in the workflow.

Properties

Name Meaning
Model Name or ID Select or specify the Stable Diffusion model checkpoint to use for image generation. Options are dynamically loaded from the connected API.
Sampler Method Name or ID Choose the sampling algorithm used during image generation. Options are dynamically loaded from the API.
Prompt Text description guiding the image generation. Supports detailed artistic and thematic descriptions.
Negative Prompt Text specifying undesired elements to exclude from the generated image (e.g., bad quality, watermark).
Width Width of the generated image in pixels.
Height Height of the generated image in pixels.
Steps Number of diffusion steps to perform; higher values generally improve quality but increase processing time.
Cfg Scale Classifier-Free Guidance scale controlling adherence to the prompt; higher values make the image more closely follow the prompt.
Seed Random seed for reproducibility; -1 indicates a random seed will be used.
Batch Count Number of images to generate in one batch.
Timeout SD Timeout in milliseconds for requests to the Stable Diffusion API. Default is 60000 ms (60 seconds).
ControlNet Units (Array) JSON array describing ControlNet units for additional conditioning of the image generation process. This allows advanced control over the output using ControlNet extensions. See ControlNet API for details.

Output

The node outputs an array of items, each containing:

  • json: An object with the parameters used for generation and additional info parsed from the API response.
  • binary.data: The generated image file in JPG format encoded as binary data, ready for downstream nodes to consume or save.

Each generated image corresponds to one output item. The binary data includes MIME type image/jpg and filename image.jpg.

Dependencies

  • Requires connection to an Automatic1111 Stable Diffusion Web UI API endpoint.
  • Needs an API key credential or authentication token configured in n8n to access the API.
  • The API host URL must be specified in the credentials.
  • Optional: ControlNet extension support requires properly formatted JSON input for ControlNet units.

Troubleshooting

  • Timeouts: If image generation takes longer than the specified timeout (Timeout SD), requests may fail. Increase the timeout value if needed.
  • Invalid model or sampler: Selecting a model or sampler not available on the API server will cause errors. Use the dynamic dropdowns to ensure valid selections.
  • Malformed ControlNet JSON: Incorrectly formatted ControlNet units JSON can cause request failures. Validate JSON syntax and structure before execution.
  • API connectivity issues: Ensure the API host is reachable and credentials are correct. Network issues or incorrect URLs will prevent successful requests.
  • Seed usage: Using a fixed seed generates deterministic images; using -1 results in random seeds. Be aware that repeated runs with the same seed produce identical images.

Links and References

Discussion