Pix2Pix Perfected: CosXL Meets Flux for Reimagining Image Composition

CosXL to Flux image editing and colorizing workflow

By combining the strengths of CosXL and Flux, we can achieve a remarkable level of control over image generation. In this article, we'll explore a workflow that leverages CosXL to transform an image, resulting in visuals with exceptional color and tone range and intricate details.

CosXL (Edit), an SDXL based Pix2Pix generative AI model, excels in rendering accurate color tones and preserving the overall aesthetic of an image. Its ability to capture subtle nuances and maintain visual coherence with simple prompt control is unparalleled. On the other hand, Flux.1 is renowned for its exceptional details and ability to generate high-quality images. Its meticulous attention to fine details and coherence complements CosXL's strengths, resulting in outputs, which would be almost impossible to achieve with standard methods (until Flux Pix2Pix or similar model appears).

From Flux to CosXL and Back Again

The workflow consists from three main steps:

  1. Generate a lo-res input image in Flux
  2. Transform the image with "Pix2pix" like prompt in CosXL Edit. The image can be upscaled to add more details.
  3. Finish and upscale the result in Flux (using latent interpolation technique)

This technique works best for tonal shifts, lighting condition changes and environments.

CosXL and FLUX upscale

Workflows

Latent Interpolation technique is using a group node I have created to mix latent diffusion nodes to avoid artifacting, the node is present in referenced workflows and you can ungroup it with 'Convert to nodes' command in ComfyUi.

You can modify the final image with CosXL directly in the output resolution, but the results lack the amount of detail compared to the workflow described in this article.

Upscale image efectivelly by Flux and CosXL model
You can use simplified workflow for editing an imported image

Forge Tips and Workaround

CosXL (Edit) does not work yet in Forge/A1111. You need to use the CosXL (Edit) workflow in ComfyUI to prepare an edit of selected images, and then use img2img in Forge to fix and upscale the results. Although you will need to switch back and forth  from Comfy to Forge, this way you may create variations of the output very effectively.

Conclusion

By combining the complementary capabilities of CosXL and Flux, we can achieve very interesting results in control over image composition, especially in tone, lighting, and overall mood of an image. This workflow is also reasonably fast, when using a lower resolution input images and Flux (schnell) model.

References and Resources:

Updated:

You may also like:

Subscribe

Stay connected to make sure you don’t miss anything. Join our newsletter community for artists, designers, and art and science enthusiasts.