Overview
This node generates images from text prompts using the PiAPI Flux Text-to-Image service. It supports multiple AI models specialized for different generation speeds and quality levels, including advanced options with LoRA (Low-Rank Adaptation) and ControlNet for enhanced control over image style and content.
Common scenarios include:
- Creating artistic or photorealistic images from descriptive text prompts.
- Generating batches of images quickly for concept art or design exploration.
- Applying specific stylistic influences via LoRA models.
- Using ControlNet to guide image generation based on input images or edge maps.
Practical examples:
- An artist generating fantasy landscape images by providing a detailed prompt and selecting a scenic LoRA style.
- A social media manager creating portrait-format images optimized for Instagram stories.
- A developer experimenting with ControlNet to generate images that follow a given pose or depth map.
Properties
| Name | Meaning |
|---|---|
| Model | The AI model used for image generation. Options: Flux 1 Dev, Flux 1 Schnell (faster batch generation), Flux 1 Dev Advanced (supports LoRA and ControlNet). |
| Prompt | The main text prompt describing the desired image content. |
| Negative Prompt | Text prompt specifying elements to avoid in the generated image. |
| Aspect Ratio | Predefined aspect ratio for the output image. Includes square, landscape, portrait formats, or custom dimensions. |
| Custom Width | Width of the generated image when "Custom" aspect ratio is selected. |
| Custom Height | Height of the generated image when "Custom" aspect ratio is selected. |
| Guidance Scale | Controls adherence to the prompt; higher values make the image more aligned with the prompt but may reduce quality. Range: 1.5 to 5. |
| Batch Size | Number of images to generate simultaneously. Only applicable for the Flux 1 Schnell model. Range: 1 to 4. |
| Use LoRA | Enable use of a LoRA model to influence image style or features. Only available with Flux 1 Dev Advanced model. |
| LoRA Type | Selects the LoRA style to apply, e.g., Anime, Art, Disney, Realism, Cyberpunk Anime, etc. |
| LoRA Strength | Intensity of the LoRA effect, from 0.1 to 1.0. |
| Use ControlNet | Enable ControlNet to guide image generation using an additional control image. Only available with Flux 1 Dev Advanced model. |
| ControlNet Type | Type of ControlNet guidance, such as Depth, Canny edges, Soft Edge, or OpenPose human pose estimation. |
| Control Image Source | Source of the control image: either a URL or binary data from previous node output. |
| Control Image URL | URL of the control image when using URL source. |
| Control Image Binary Property | Name of the binary property containing the control image data when using binary data source. |
| Control Strength | Strength of the ControlNet effect, from 0.1 to 1.0. |
| Return Preprocessed Image | Whether to return the preprocessed control image used internally by ControlNet. |
| Wait for Completion | Whether to wait for the image generation task to complete before returning results. |
Output
The node outputs JSON objects containing the response from the PiAPI Flux Text-to-Image API. This includes:
- Task details such as task ID and status.
- Generated image URLs or base64 data depending on the API response.
- If ControlNet preprocessing is enabled, optionally returns the preprocessed control image.
- In case of batch generation, multiple images are included in the response.
If the node encounters errors during execution, it outputs JSON with an error field describing the issue.
The node does not directly output binary image data but provides URLs or encoded image data within the JSON response.
Dependencies
- Requires an API key credential for the PiAPI Flux service.
- Uses the PiAPI Flux REST API endpoint
/api/v1/taskfor submitting image generation tasks. - Supports asynchronous task completion polling if "Wait for Completion" is enabled.
- No other external dependencies beyond standard n8n environment and the configured API credential.
Troubleshooting
- Invalid binary data for ControlNet: If using binary data as control image, ensure the binary property contains valid image data with an appropriate MIME type (e.g., image/png, image/jpeg). Errors will be thrown if the data is missing or not an image.
- Unsupported batch size: Batch size >1 only works with the Flux 1 Schnell model. Using batch sizes with other models may cause unexpected behavior.
- Model-specific features: LoRA and ControlNet options are only available with the Flux 1 Dev Advanced model. Selecting these options with other models will have no effect or cause errors.
- API errors: Network issues or invalid API credentials will result in error messages returned from the API. Verify API key validity and network connectivity.
- Prompt requirements: The prompt field is required. Omitting it will cause the node to fail.
- Aspect ratio validation: When using custom aspect ratio, width and height must be specified and reasonable to avoid API rejection.