[COMFY UI] - Integration with ComfyUI, AUTOMATIC1111, Swarm UI Workflow

I have been using various Stable Diffusion workflows to upscale my generated images. While I have found ComfyUI invaluable with this, Topaz Photo AI is on another level. The speed and quality of the upscaled images it outputs on my M1 Max MacBook are incredible.

As I still heavily use ComfyUI (and StableSwarmUI) for image generation, I would love you guys to produce a node/extension/plugin for these systems so I can integrate Photo AI into my existing workflow. Previewing a generated image in ComfyUI and then sending it to a Photo AI node to upscale/enhance would not only reduce the time it takes to travel between apps but also mean a much simpler workflow within existing setups.

The app is incredible, but sometimes I just want a single system setup :slight_smile:

Thanks for the idea and suggestion! I haven’t worked with ComfyUI so I will have to check it out.

Make sure that you do not forget to vote for your idea :slight_smile:

1 Like

I am also looking for this.

1 Like

I’d also love an intergration like this. ComfyUI has a large, modular community. Depsite a vast majority of custom nodes being opensoure, a simple API which locally calls to the topaz app would allow users like us to utilise this service within our favourite image generators. Furthermore, it’ll open a huge new audience base who’re looking for an inhouse solution to efficiently upscaling. Currently the most popular upscaler operate through tiles (for efficiency), but has mixed results.

This intergration would solidify topaz as THE leader in upscale, denoise, etc.

Thanks!

1 Like

I guess you could implement it yourself if you knew the parameters. Based on the behavior of Photo AI when you start it as a subprocess from Python. I strongly suspect that the picture will be returned.
But even without that, it could work, provided that a corresponding parameter is available.

As an base idea:

import subprocess
import os
import time
from comfyui import ComfyUI

class TopazPhotoAINode(ComfyUI.Node):
    """
    Untested minimal example
    
    Additional Informations:
        https://github.com/comfyanonymous/ComfyUI/blob/master/custom_nodes/example_node.py.example
        https://www.reddit.com/r/comfyui/comments/18wp6oj/tutorial_create_a_custom_node_in_5_minutes/

    """
    def __init__(self):
        super().__init__()
        self.app_path = "C:\\Program Files\\Topaz Labs LLC\\Topaz Photo AI\\Topaz Photo AI.exe"

    def process(self, input_image_path):
        base, ext = os.path.splitext(input_image_path)
        output_image_path = f"{base}.topaz{ext}"
        command = f'"{self.app_path}" "{input_image_path}"' # params needed
        subprocess.run(command, shell=True)

        # wait
        while not os.path.exists(output_image_path):
            time.sleep(1)

        return output_image_path

# Register node
ComfyUI.register_node('TopazPhotoAINode', TopazPhotoAINode)