Flux.2 Klein 9B: Extensión de Imagen - After
Flux.2 Klein 9B: Extensión de Imagen - Before

The 'Flux.2 Klein 9B: Image Extend' workflow is designed to expand and enhance images using the FLUX.2 Klein 9B model. This workflow excels at outpainting, a technique that extends the boundaries of an image while maintaining its original style and content. It leverages a combination of advanced nodes such as SamplerCustomAdvanced, CLIPLoader, and RandomNoise to generate seamless extensions of the input image. By using the ComfyUI-Color-Matcher and comfyui-kjnodes, the workflow ensures color consistency and style coherence, making it particularly useful for artists and designers looking to create expansive compositions from limited source material.

Technically, the workflow begins by loading an image and encoding it into a latent space using the VAEEncode node. The image is then padded using the ImagePadForOutpaint node to create space for the new content. The Flux2Scheduler and UNETLoader nodes work together to generate new image data that blends naturally with the existing content. The process is guided by the CFGGuider and KSamplerSelect nodes, which help refine the image generation based on the input prompts and conditions. Once the outpainting is complete, the VAEDecode node converts the latent representation back into a visible image format, ready for saving or further editing.

API

Usa este flujo de trabajo desde código

Cada flujo de trabajo de Comfy es un grafo JSON. El siguiente payload es este flujo de trabajo, exactamente como lo ejecuta ComfyUI: descárgalo desde la URL, guárdalo en control de versiones o cárgalo en ComfyUI y ejecútalo nodo por nodo.

templates_doc_workbox_klein_9b_image_extend.json
Obteniendo JSON del flujo de trabajo…

Ejecuta desde TypeScript o Python con el Comfy SDK. El mismo código funciona en Comfy Cloud o en un ComfyUI propio: solo cambia la URL base.

// Install (beta)
npm i @comfyorg/sdk

// Run "Flux.2 Klein 9B: Extensión de Imagen" (TypeScript)
import { Comfy } from "@comfyorg/sdk";

const client = new Comfy({ apiKey: "comfyui-..." });

// This workflow, exported in API format (see note below)
const wf = await client.workflows.fromFile("templates_doc_workbox_klein_9b_image_extend_api.json");

const asset = client.assets.fromFile("input.png");
wf.setInput("159", "image", asset); // LoadImage

wf.setInput("157", "text", "remove the green part"); // CLIPTextEncode

const job = await client.run(wf);
await job.getOutputs("142")[0].toFile("output.png"); // SaveImage

El SDK utiliza un flujo de trabajo en formato API: abre este flujo de trabajo en ComfyUI y usa Archivo → Exportar flujo de trabajo (API).

El acceso a la API de Comfy Cloud requiere un plan con clave API.

Preguntas frecuentes

Preguntas Frecuentes

Ver todos los workflows
Showing 30 of 30 templates