PiAPI Flux Image to Image icon

PiAPI Flux Image to Image

Transform images using PiAPI Flux Image-to-Image

Overview

This node transforms images using the PiAPI Flux Image-to-Image service. It allows users to input an image and apply various AI-driven transformations based on text prompts, optionally refining results with advanced features like LoRA models and ControlNet. This is useful for creative workflows such as enhancing photos, generating art variations, or applying specific stylistic changes to images.

Practical examples include:

  • Transforming a photo by describing desired changes in a prompt.
  • Generating multiple stylized versions of an image using batch processing.
  • Applying specialized artistic styles or effects via LoRA models.
  • Using ControlNet to guide image generation with edge detection or pose estimation.

Properties

Name Meaning
Model The AI model used for image transformation. Options: Flux 1 Dev, Flux 1 Schnell, Flux 1 Dev Advanced.
Image Source Source of the input image. Options: URL (provide image URL), Binary Data (use binary data from previous node).
Image URL URL of the image to transform (required if Image Source is URL).
Binary Property Name of the binary property containing the image data (required if Image Source is Binary Data).
Prompt Text prompt describing how to transform the image (required).
Negative Prompt Text prompt specifying what to avoid in the transformation.
Denoise Strength Controls how much the image is transformed, from 0.01 (minimal change) to 1.0 (maximum change). Default is 0.7.
Guidance Scale Influences adherence to the prompt; higher values improve prompt fidelity but may reduce image quality. Range: 1.5 to 5. Default is 3.
Batch Size Number of images to generate simultaneously (only works with Flux 1 Schnell model). Range: 1 to 4. Default is 1.
Use LoRA Whether to use a LoRA model for generation (only available with Flux 1 Dev Advanced model). Boolean.
LoRA Type The LoRA style to apply when enabled. Options include Anime, Art, Disney, Furry, MidJourney v6, Realism, Scenery, and many others. Default is None.
LoRA Strength Strength of the LoRA effect, from 0.1 to 1.0. Default is 1.
Use ControlNet Whether to use ControlNet for generation (only available with Flux 1 Dev Advanced model). Boolean.
ControlNet Type Type of ControlNet guidance to use. Options: None, Depth, Canny (edge detection), Soft Edge, OpenPose (human pose estimation). Default is None.
Control Strength Strength of the ControlNet effect, from 0.1 to 1.0. Default is 0.5.
Return Preprocessed Image Whether to return the preprocessed control image from ControlNet. Boolean.
Wait for Completion Whether to wait for the image generation task to complete before returning results. Boolean. Default is false.

Output

The node outputs JSON objects containing the response from the PiAPI Flux image transformation API. The output includes details about the generated images or task status.

  • If Wait for Completion is enabled, the output contains the completed task results including generated images.
  • If not waiting, the output contains initial task information, possibly including a task ID.
  • When using ControlNet with Return Preprocessed Image, the output may include the preprocessed control image.
  • The node can handle binary image data input but outputs only JSON metadata and URLs or base64-encoded images as returned by the API.

Dependencies

  • Requires an API key credential for PiAPI Flux service.
  • Needs network access to PiAPI endpoints.
  • No additional external dependencies beyond the PiAPI Flux API.
  • Configuration of the API key credential in n8n is mandatory.

Troubleshooting

  • Invalid image data error: Occurs if the binary input is not an image MIME type. Ensure the binary property contains valid image data.
  • Missing required parameters: The node requires either a valid image URL or binary image data, and a prompt. Make sure these are provided.
  • Model-specific options: Some properties like Batch Size only work with certain models (e.g., Flux 1 Schnell). Using them with incompatible models will have no effect.
  • LoRA and ControlNet usage: These features are only available with the Flux 1 Dev Advanced model. Enabling them with other models will be ignored or cause errors.
  • API request failures: Network issues or invalid API credentials will cause errors. Verify API key validity and network connectivity.
  • Task completion waiting: If Wait for Completion is enabled, long-running tasks may delay workflow execution. Disable if immediate response is preferred.

Links and References

Discussion