⚙️ TiledImageGenerationConfig.json
{
  "output_file": "posters/cyberpunk_city.png",
  "prompts": [
    "A sprawling cyberpunk city at night",
    "Detailed neon signs and rainy streets",
    "Cybernetic implants and micro-textures"
  ],
  "upscale_factor": 2.0,
  "grid_schedule": [2, 3],
  "tile_overlap": 0.15
}
👁️ Session UI Output
✔ Final Result: 4096 x 4096 px

Configuration Parameters

Field Type Description
output_file * String The output file path for the final high-res image.
prompts * List<String> One prompt per level of detail. First is for the base image.
input_file String Optional base image to upscale instead of generating one.
upscale_factor Double Scale per level (Default: 2.0).
grid_schedule List<Int> Grid spec per level (e.g. [2, 3] for 2x2 then 3x3).
tile_overlap Double Overlap fraction (0.0-1.0) to prevent seams (Default: 0.15).
min_region_size Int Min pixels to trigger refinement (Default: 128).
retarget_subimages Boolean Aligns refined crops to original bounds (Default: true).

Task Execution Lifecycle

  1. Initialization: Validates output paths and ensures prompts are provided for each recursion depth.
  2. Base Generation: Generates the root image using the first prompt or loads the input_file.
  3. Recursive Tiling:
    • Divides the image into a grid based on grid_schedule.
    • Upscales the image using bicubic interpolation.
    • Extracts each tile and refines it using Img2Img with the next prompt in the list.
    • Applies a feathering algorithm to tile edges to ensure seamless blending.
  4. Composition: Pastes refined tiles back onto the high-resolution canvas, repeating until maxDepth is reached.

Kotlin Integration

Add this task to your OrchestrationConfig to enable high-res generation capabilities.

val task = TiledImageGenerationTask(
    orchestrationConfig = config,
    planTask = TiledImageGenerationConfig(
        output_file = "output/ultra_res.png",
        prompts = listOf(
            "A fantasy landscape",
            "Detailed flora and fauna",
            "Intricate leaf textures and insects"
        ),
        upscale_factor = 2.0,
        grid_schedule = listOf(2, 2)
    )
)