chaiNNer-org / chaiNNer

A node-based image processing GUI aimed at making chaining image processing tasks easy and customizable. Born as an AI upscaling application, chaiNNer has grown into an extremely flexible and powerful programmatic image processing application.
https://chaiNNer.app
GNU General Public License v3.0
4.52k stars 280 forks source link

how to apply models other than listed types (upscale, remove bg, inpaint) #2811

Closed Johnreidsilver closed 5 months ago

Johnreidsilver commented 5 months ago

Hi, was trying out chaiNNer (thx btw! super simple to install in Ubuntu and excellent GUI), and it works fine with upscaling models, but what about other models like deblur, dehaze, and low light correction ? I can load them, but can't figure how to apply those.

For example: https://github.com/VITA-Group/EnlightenGAN

This one will fail on load with a "not supported" message. I tried with an ONNX version from here: https://github.com/PINTO0309/PINTO_model_zoo/tree/main/214_EnlightenGAN

It doesn't throw an error loading, but I can only connect it to either upscale

An error occurred in a onnx Upscale Image node:

Required inputs (['gray']) are missing from input feed (['input.1']).

Input values:
• Image: RGB Image 320x230
• Model: Value of type 'nodes.impl.onnx.model.OnnxGeneric'
• Tile Size: 256
• Separate Alpha: No

or remove bg that doesn't let the chain to be established with subtype "generic" not connectable to subtype "RemBg"

Do you plan to add support for this kind of "filtering" models or is it out of scope of chaiNNer ?

joeyballentine commented 5 months ago

The "upscale image" node for onnx is really just a "run model" node. That being said though, not every model is guaranteed to work. We only officially support models converted from pytorch to onnx or ncnn on either of those frameworks.

As for what's supported by pytorch, we have to add support for models manually. You can't just find some random code on GitHub and expect the model to work. If you want it to be supported, create an issue in the spandrel repo: https://github.com/chaiNNer-org/spandrel

Hopefully that clears things up a bit

Johnreidsilver commented 5 months ago

Thanks, been messing with different models and found one that works for dehazing: https://github.com/AmeryXiong/MixDehazeNet

edit: I see you already have in on the spandrel list