phineas-pta / comfy-trt-test

attempt to use TensorRT with ComfyUI
Apache License 2.0
82 stars 3 forks source link

Converted Turbo XL Successfully but was getting black images #4

Open boricuapab opened 11 months ago

boricuapab commented 11 months ago

I think something changed with comfy that is causing the turbo xl tensor rt model to render our black images.

Im on this comfy commit

commit b0aab1e4ea3dfefe09c4f07de0e5237558097e22 (HEAD -> master, origin/master, origin/HEAD)
Author: comfyanonymous <comfyanonymous@protonmail.com>
Date:   Mon Dec 11 18:36:29 2023 -0500

    Add an option --fp16-unet to force using fp16 for the unet.

This was the error

C:\sdComfyUITRT\ComfyUI\nodes.py:1363: RuntimeWarning: invalid value encountered in cast
  img = Image.fromarray(np.clip(i, 0, 255).astype(np.uint8))

I was able to fix it by adding this fp8 flag when lauching comfy

python -s main.py --auto-launch --fp8_e4m3fn-unet

ComfyUI_temp_sqacd_00014_

phineas-pta commented 11 months ago

hmmm that's weird, but i dont have rtx 40xx to use fp8

what settings u using ?

boricuapab commented 11 months ago

I have an rtx 2060 super.

I compiled it with these settings


python convert_unet.py --ckpt_path ..\..\models\checkpoints\sd_xl_turbo_1.0_fp16.safetensors --batch_max 4 --height_min 512 --width_min 512 --height_max 1024 --width_max 1024 --token_count_max 300
phineas-pta commented 10 months ago

i can reproduce this issue, i have no idea why, need to dive deep into comfyui code base ðŸ«