Chaoses-Ib / ComfyScript

A Python frontend and library for ComfyUI
https://discord.gg/arqJbtEg7w
MIT License
432 stars 24 forks source link

Real mode and UltimateSDUpscale node #20

Closed roKadikis closed 10 months ago

roKadikis commented 10 months ago

Hi, I'm getting error running ultimate upscale in real mode. Virtual mode works fine.

from comfy_script.runtime.real import *
load()
from comfy_script.runtime.real.nodes import *

im, mask = LoadImage('test.png')

with Workflow():

    base_model, base_clip, base_vae = CheckpointLoaderSimple('deliberate_v3.safetensors') 
    upscale_model = UpscaleModelLoader('4x-UltraSharp.pth')

    conditioning = CLIPTextEncode('', base_clip)

    upscaled_image = UltimateSDUpscale(
        image=im,
        model=base_model,
        positive=conditioning,
        negative=conditioning, 
        vae=base_vae,
        upscale_by=2,
        seed=0,
        steps=18,
        cfg=1,
        sampler_name='ddpm',
        scheduler='karras',
        denoise=0.2,
        upscale_model=upscale_model, 
        mode_type='Linear',
        tile_width=1024,
        tile_height=1024,
        mask_blur=16,
        tile_padding=32,
        seam_fix_mode='Half Tile',
        seam_fix_denoise=0.5,
        seam_fix_width=64,
        seam_fix_mask_blur=16,
        seam_fix_padding=32, 
        force_uniform_tiles=False, 
        tiled_decode=False) 
Traceback (most recent call last):
  File "/home/ro/test.py", line 17, in <module>
    upscaled_image = UltimateSDUpscale(
  File "/home/ro/ComfyUI/custom_nodes/ComfyScript/src/comfy_script/runtime/real/nodes.py", line 91, in new
    outputs = getattr(obj, obj.FUNCTION)(*args, **kwds)
  File "/home/ro/ComfyUI/custom_nodes/ComfyUI_UltimateSDUpscale/nodes.py", line 116, in upscale
    sdprocessing = StableDiffusionProcessing(
  File "/home/ro/ComfyUI/custom_nodes/ComfyUI_UltimateSDUpscale/modules/processing.py", line 40, in __init__
    self.vae_decoder = VAEDecode()
  File "/home/ro/ComfyUI/custom_nodes/ComfyScript/src/comfy_script/runtime/real/nodes.py", line 91, in new
    outputs = getattr(obj, obj.FUNCTION)(*args, **kwds)
TypeError: VAEDecode.decode() missing 2 required positional arguments: 'vae' and 'samples'
Chaoses-Ib commented 10 months ago

It should be fixed now. Please run git pull to update and test again.

By the way, you can now use enums instead of string literals if you want:

base_model, base_clip, base_vae = CheckpointLoaderSimple(Checkpoints.deliberate_v3)
upscale_model = UpscaleModelLoader(UpscaleModels.4x_UltraSharp)
roKadikis commented 10 months ago

Thanks for such quick updates and tips!