Upscaling and Style Transfer with ComfyUI

Two very useful jobs which can be done with ComfyUI are AI based upscaling and style transfer. While image packages are starting to include these features, comfyUI allows you a choice of models and fine control of your pipeline. This makes it useful for obtaining high quality results

Example Upscaling Pipeline

First you will need to install some new nodes. If you do not already have ComfyUI-Manager as recommended in my last post, then you will need to install that first. Then install the following:

  • UltimateSDUpscale
  • ComfyMath
  • Recommended Resolution Calculator
This image contains an upscale workflow
This image contains an upscale workflow

Next download the workflow from my Github (or the image above which contains the workflow too), place in in your ComfyUI folder and load it. Specify the file to be upscaled, the upscaling model and the modification model and the upscaling factor  (in the Primitive node  just under the file loading node). Run the workflow and you should get a nice upscaled image out. Images can of course be tweaked if desired with the positive and negative prompts. Unfortunately the node used for uploading the image does not easily browse the folder, but it does allow for easily reaching all parts of your comfyUI setup, and also including the original name in the upscaled outputs filename.

Example Style Transfer Pipeline

One of the best implementations of style transfer available for ComfyUI is the one by ExponentialML. This is itself based on some work by Naver.  The nodes can be imported directly from the ComfyUI plugin manager. You need to search for ComfyUI_VisualStylePrompting . The workflow is also available from the ExponentialML Github by downloading the illustrative image. The workflow is also embedded in the image below.

An example of style transfer complete with workflow
An example of style transfer complete with workflow

Of course it might be nice to be able to feed a specific image for composition rather than a prompt. Fortunately there is a node which can allow for this as well. Enter the ComfyUI_IPAdapter_plus node from cubiq. Sadly the workflows he provided in that repo did not work for me, so I have recreated a copy which can be found in my Github repository. The workflow is also embedded in the image below.

The IPAdapter workflow is embedded in this image
The IPAdapter workflow is embedded in this image

Other Interesting Workflows

Other interesting workflows include one for generating stable characters, animation workflows and plenty of others. One thing I have found is that many workflows do not work quite as advertised out of the box. Control nets in particular sometimes give strange results, but there can be other idiosyncrasies too. At this stage the technology is still in its infancy. Image generation frameworks like ComfyUI and Automatic1111 are built out of a lot of only partially compatible components by volunteers. This sometimes leads  to dependency issues and unstable workflows. However the power of these systems is impressive and their capabilities will only improve with time.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.