Automatic1111 Node icon

Automatic1111 Node

Interacts with Automatic1111 API

Overview

The node interacts with the Automatic1111 API, which is a popular interface for Stable Diffusion image generation models. Specifically, the "Set Model" operation allows users to change the active Stable Diffusion model used by the API for subsequent image generation tasks.

This operation is useful when you want to switch between different pre-trained models dynamically within an automation workflow, without manually changing settings in the API interface. For example, you might have multiple models optimized for different styles or subjects and want to select the appropriate one before generating images.

Practical example:

  • Before generating an image from text prompts, use this node to set the desired Stable Diffusion model by its name or ID.
  • Automate workflows that generate images with different models based on input data or user preferences.

Properties

Name Meaning
Select Model Name or ID The Stable Diffusion model to set as active. Choose from a dynamically loaded list of available models or specify a model ID using an expression. This determines which model the API will use for image generation.

Output

The output JSON contains a simple confirmation object indicating success:

{
  "result": "success"
}

This confirms that the model was successfully set in the Automatic1111 API.

No binary data is output by this operation.

Dependencies

  • Requires connection to an Automatic1111 API endpoint (a running instance of the Automatic1111 Stable Diffusion web API).
  • Requires an API URL credential configured in n8n to authenticate and connect to the Automatic1111 API.
  • The node fetches available models dynamically from the API endpoint /sdapi/v1/sd-models to populate the model selection dropdown.

Troubleshooting

  • Common issues:

    • Incorrect or unreachable API URL: Ensure the Automatic1111 API URL credential is correctly configured and the API server is accessible.
    • Model not found: If the selected model name does not exist on the server, the API may reject the request. Use the dynamic model list to avoid typos.
    • Network errors: Check network connectivity and firewall settings if requests fail.
  • Error messages:

    • HTTP errors from the API (e.g., 404, 500) indicate issues with the API endpoint or request payload.
    • Authentication errors suggest misconfigured credentials.

To resolve these, verify API URL correctness, ensure the API server is running, and confirm the model name is valid.

Links and References

Discussion