Zen-Inpaint ## Sections • [Zeninpaint API](https://app.theneo.io/fotographer/zen-inpaint/zeninpaint-api.md): AI-powered image generation and inpainting API supporting three generation modes: Mode 1: Inpainting - Traditional inpainting with subject, mask, and background Mode 2: Scene Generation - Generate scenes from depth maps or 3D previews Mode 3: Background Generation - Generate new backgrounds around subjects using edge detection The API supports both synchronous and asynchronous (polling) processing modes. 📍 Important: Endpoint Structure This OpenAPI spec uses virtual paths for clarity. The actual endpoints are: Sync Mode (all gen_modes): Actual URL: https://zen-inpaint-1066271267292.europe-west1.run.app Async Mode (all gen_modes): Actual URL: https://zeninpaint-pro-1066271267292.europe-west1.run.app/run Polling: Actual URL: https://zeninpaint-pro-1066271267292.europe-west1.run.app/predict The virtual paths help organize the documentation by generation mode, but all requests to the sync server use the base URL, and all async job submissions use /run . 🔑 Authentication All endpoints (except /ping ) require two headers: x-api-key : Your API key x-email : Your registered email 💳 Credits Each request consumes 0.04~ 0.05 (for >2k images) credits. Ensure sufficient credits before making requests. • [Mode 1 - Inpainting](https://app.theneo.io/fotographer/zen-inpaint/mode-1-inpainting.md): Traditional inpainting combining subject, mask, and background. Available in both sync and async modes. • [Mode 1 - Inpainting (Sync)](https://app.theneo.io/fotographer/zen-inpaint/mode-1-inpainting/mode-1-inpainting-sync.md): Actual Endpoint: POST https://zen-inpaint-1066271267292.europe-west1.run.app Traditional inpainting mode that combines a subject, mask, and background image. Returns the generated image directly in the response. Concurrent Requests: Up to 14 simultaneous requests Timeout: 300 seconds • [Mode 1 - Inpainting (Async)](https://app.theneo.io/fotographer/zen-inpaint/mode-1-inpainting/mode-1-inpainting-async.md): Actual Endpoint: POST https://zeninpaint-pro-1066271267292.europe-west1.run.app/run Submit an inpainting job asynchronously. Returns a ticket ID for polling. Use the /predict endpoint to check status and retrieve results. Advantages: No timeout issues for long-running jobs Process multiple requests concurrently Queue system manages resources automatically • [Mode 2 - Scene Generation](https://app.theneo.io/fotographer/zen-inpaint/mode-2-scene-generation.md): Generate photorealistic scenes from depth maps or 3D previews. Available in both sync and async modes. • [Mode 2 - Scene Generation (Sync)](https://app.theneo.io/fotographer/zen-inpaint/mode-2-scene-generation/mode-2-scene-generation-sync.md): Actual Endpoint: POST https://zen-inpaint-1066271267292.europe-west1.run.app Generate photorealistic scenes from depth maps or 3D preview renders. The system extracts depth maps and canny structure from preview images. Concurrent Requests: Up to 14 simultaneous requests Timeout: 300 seconds • [Mode 2 - Scene Generation (Async)](https://app.theneo.io/fotographer/zen-inpaint/mode-2-scene-generation/mode-2-scene-generation-async.md): Actual Endpoint: POST https://zeninpaint-pro-1066271267292.europe-west1.run.app/run Submit a scene generation job asynchronously. Returns a ticket ID for polling. Use the /predict endpoint to check status and retrieve results. • [Mode 3 - Background Generation](https://app.theneo.io/fotographer/zen-inpaint/mode-3-background-generation.md): Generate new backgrounds around subjects using edge detection. Requires PNG with transparent background. Available in both sync and async modes. • [Mode 3 - Background Generation (Sync)](https://app.theneo.io/fotographer/zen-inpaint/mode-3-background-generation/mode-3-background-generation-sync.md): Actual Endpoint: POST https://zen-inpaint-1066271267292.europe-west1.run.app Generate new realistic backgrounds around a subject while maintaining its placement. Uses edge detection to preserve subject boundaries. Subject Requirement: PNG with transparent background Concurrent Requests: Up to 14 simultaneous requests Timeout: 300 seconds • [Mode 3 - Background Generation (Async)](https://app.theneo.io/fotographer/zen-inpaint/mode-3-background-generation/mode-3-background-generation-async.md): Actual Endpoint: POST https://zeninpaint-pro-1066271267292.europe-west1.run.app/run Submit a background generation job asynchronously. Returns a ticket ID for polling. Use the /predict endpoint to check status and retrieve results. • [Polling](https://app.theneo.io/fotographer/zen-inpaint/polling.md): Check status and retrieve results for async jobs • [Poll Job Status](https://app.theneo.io/fotographer/zen-inpaint/polling/poll-job-status.md): Actual Endpoint: POST https://zeninpaint-pro-1066271267292.europe-west1.run.app/predict Check the status of an asynchronous job and retrieve results when ready. Works with all generation modes (inpaint, scene_generation, bg_generation). Polling Best Practices: Poll every 1-2 seconds for optimal performance Set max wait time to 300 seconds (5 minutes) Handle network errors with retry logic • [Health](https://app.theneo.io/fotographer/zen-inpaint/health.md): Health check and warm-up endpoints • [Ping & Warm-up](https://app.theneo.io/fotographer/zen-inpaint/health/health-check-and-warm-up.md): Ping endpoint to wake up cold instances and set priority for faster subsequent requests. Does NOT require authentication. • [Ping & Warm-up (POST)](https://app.theneo.io/fotographer/zen-inpaint/health/health-check-and-warm-up-post.md): Alternative POST method for ping endpoint. Does NOT require authentication.