Pix2Pix Perfected: CosXL Meets Flux for Reimagining Image Composition
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:
- Generate a lo-res input image in Flux
- Transform the image with "Pix2pix" like prompt in CosXL Edit. The image can be upscaled to add more details.
- Finish and upscale the result in Flux (using latent interpolation technique)
This technique works best for tonal shifts, lighting condition changes and environments.
Workflows
- Download from github https://github.com/sandner-art/ai-research/tree/main/CosXL-Workflows/FLUX-UPSCALE-CosXL
- CosXL simple workflows for testing (not needed for the subject of this article): https://github.com/sandner-art/ai-research/tree/main/CosXL-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.
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:
- CosXL Edit (Cinematix) model to download from Civitai
- CosXL Edit article on this site
- Workflows https://github.com/sandner-art/ai-research/tree/main/CosXL-Workflows/FLUX-UPSCALE-CosXL + https://github.com/sandner-art/ai-research/tree/main/FLUX/UPSCALE-FLUX-Experiments