# Instant Background V2

**Action ID:** `instant_background_v2`

## Description

Instantly create stunning AI-generated scene backgrounds for your product images with one click, offering commercial-grade quality and a diverse style selection for every need

## Connection

| Name               | Description                                 | Required | Category |
| ------------------ | ------------------------------------------- | -------- | -------- |
| PixelML Connection | The PixelML connection to call PixelML API. | True     | pixelml  |

## Input Schema

```json
{
  "description": "instant background v2 node input.",
  "properties": {
    "image_url": {
      "title": "Image url",
      "type": "string"
    },
    "prompt": {
      "title": "Describe the new background you want to add to the image.",
      "type": "string"
    },
    "negative_prompt": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Negative prompt"
    },
    "padding_top": {
      "anyOf": [
        {
          "maximum": 512,
          "minimum": 0,
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Padding top"
    },
    "padding_bottom": {
      "anyOf": [
        {
          "maximum": 512,
          "minimum": 0,
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Padding bottom"
    },
    "padding_left": {
      "anyOf": [
        {
          "maximum": 512,
          "minimum": 0,
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Padding left"
    },
    "padding_right": {
      "anyOf": [
        {
          "maximum": 512,
          "minimum": 0,
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Padding right"
    }
  },
  "required": [
    "image_url",
    "prompt",
    "negative_prompt",
    "padding_top",
    "padding_bottom",
    "padding_left",
    "padding_right"
  ],
  "title": "InstantbackgroundV2NodeInput",
  "type": "object"
}
```

## Output Schema

```json
{
  "description": "instant background v2 node output.",
  "properties": {
    "image": {
      "title": "Image output",
      "type": "string"
    }
  },
  "required": [
    "image"
  ],
  "title": "InstantbackgroundV2NodeOutput",
  "type": "object"
}
```

## How It Works

This node uses PixelML's AI to automatically remove the existing background from your product image and replace it with a stunning AI-generated scene based on your text prompt. The AI intelligently detects the main subject, preserves its details and lighting, and seamlessly composites it onto the new background. You can control canvas expansion using padding parameters to add space around your subject, and use negative prompts to exclude unwanted elements from the generated background.

## Usage Examples

### Example 1: Product Photography with Natural Background

**Input:**

```
image_url: "https://example.com/watch-product.jpg"
prompt: "Luxury wooden desk with soft natural sunlight, elegant minimalist office setting"
negative_prompt: "cluttered, messy, dark, blurry"
padding_top: 100
padding_bottom: 100
padding_left: 150
padding_right: 150
```

**Output:**

```
image: "https://pixelml.com/output/watch-elegant-desk-bg.jpg"
```

### Example 2: E-Commerce Fashion with Studio Background

**Input:**

```
image_url: "https://example.com/sneaker.png"
prompt: "Professional photography studio with white seamless backdrop, studio lighting setup, commercial product shoot"
negative_prompt: "outdoor, natural, shadows, reflections"
padding_top: 50
padding_bottom: 50
padding_left: 50
padding_right: 50
```

**Output:**

```
image: "https://pixelml.com/output/sneaker-studio-bg.jpg"
```

### Example 3: Lifestyle Scene for Social Media

**Input:**

```
image_url: "https://example.com/coffee-mug.jpg"
prompt: "Cozy coffee shop interior, warm ambient lighting, wooden table with plants, instagram aesthetic"
negative_prompt: "people, faces, text, logos"
padding_top: 200
padding_bottom: 100
padding_left: 200
padding_right: 200
```

**Output:**

```
image: "https://pixelml.com/output/coffee-lifestyle-bg.jpg"
```

## Common Use Cases

* **E-Commerce Product Photography**: Create professional product images with various background styles for online stores without expensive photoshoots
* **Social Media Marketing**: Generate eye-catching product images with lifestyle backgrounds for Instagram, Facebook, and other platforms
* **A/B Testing**: Quickly create multiple background variations of the same product to test which performs best with your audience
* **Seasonal Campaigns**: Transform product images with holiday-themed or seasonal backgrounds without reshooting inventory
* **Brand Consistency**: Maintain consistent background styles across your entire product catalog for professional presentation
* **Cost Reduction**: Eliminate the need for expensive studio rentals, professional photographers, and multiple photoshoots
* **Rapid Prototyping**: Visualize products in different environments before committing to physical photoshoots

## Error Handling

| Error Type               | Cause                                                    | Solution                                                                           |
| ------------------------ | -------------------------------------------------------- | ---------------------------------------------------------------------------------- |
| Invalid Image Format     | Image format not supported (not PNG, JPEG, JPG, or WebP) | Convert your image to PNG, JPG, JPEG, or WebP format before processing             |
| Image URL Not Accessible | Image URL is broken or not publicly accessible           | Ensure the image URL is valid and publicly accessible without authentication       |
| Subject Detection Failed | AI cannot identify the main subject in the image         | Use images with clear, well-defined subjects and good contrast with the background |
| Padding Exceeds Limit    | Padding values exceed maximum of 512 pixels              | Reduce padding values to 512 pixels or less per side                               |
| Negative Padding         | Padding values are negative numbers                      | Use positive integer values (0-512) for all padding parameters                     |
| Empty Prompt             | Prompt field is empty or null                            | Provide a descriptive text prompt explaining the desired background scene          |
| PixelML Connection Error | Invalid or missing PixelML API credentials               | Verify your PixelML connection is properly configured with valid API key           |

## Notes

* **Image Quality**: Use high-resolution product images (minimum 1000px on the longest side) for best results and commercial-grade output
* **Subject Clarity**: Images with clear subject separation from the background produce better results than busy or complex compositions
* **Padding Control**: Use padding to add breathing room around your subject and create professional composition with the new background
* **Prompt Specificity**: Detailed prompts produce more accurate backgrounds. Include lighting, style, mood, and setting details
* **Negative Prompts**: Use negative prompts to prevent unwanted elements like people, text, or clutter from appearing in the background
* **Processing Time**: Complex backgrounds may take 30-60 seconds to generate depending on image size and prompt complexity
* **Commercial Use**: PixelML-generated backgrounds are suitable for commercial use in e-commerce and marketing materials
* **Batch Processing**: Process multiple products with the same background prompt to maintain consistency across your catalog


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.agenticflow.ai/reference/nodes/instant_background_v2.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
