Skip to content

Alpha v0.12.0

Compare
Choose a tag to compare
@github-actions github-actions released this 04 Sep 15:06
· 1431 commits to main since this release

AMD users rejoice: a long-awaited, highly requested feature is finally here: PyTorch to NCNN conversion! @theflyingzamboni did a wonderful job converting the original onnx2ncnn C++ code into python code in order to make this happen. Under the hood, we're converting from PyTorch to ONNX to NCNN (which you can still do if you want to), but we also have direct PyTorch to NCNN conversion for convenience. This means no more needing to convert to ONNX and use convertmodel.com! It can all be done in chaiNNer. Note: Make sure you have up-to-date NCNN and ONNX packages from the dependency manager in order for this to work properly

The other big thing this release is SwinIR support (for PyTorch). I've wanted to add this architecture for a while and I finally got around to it. It is a really good Super Resolution architecture with lots of great pretrained models to use. Ideally, we support every variation of SwinIR model (with all the params auto-detected), but if any of the SwinIR models give you an error please let me know and I'll try to resolve it. One weird thing about SwinIR is that it actually doesn't support fp16, so that will be automatically disabled when using this arch (so that means no fp16 speed-up). It also doesn't support conversion to NCNN, as NCNN does not support all the operations required for the architecture. Next-up architecture additions: GFPGAN and HAT (no ETA on these yet though).

I've also reworked how the PyTorch auto-tiling works. After some experimenting, I was able to use the VRAM estimations I added a while back in the logging (with a bit of added safety) instead of the old try/catch splitting method. This yielded a significant performance boost for PyTorch upscaling in general, though only when upscaling with GPU. CPU upscaling is unaffected by this change.

I've also done a bit to reduce some of the RAM overhead we previously had. Before, we weren't clearing out our internal output cache until after the entire chain was finished processing. This caused RAM usage to build up significantly for large chains, especially with large images. Now, we clear out things we no longer need so that RAM usage stays as low as possible at all times.

There's also a lot more added in this release, so here is the full changelog:

Dependency Updates

  • NCNN
    • There isn't actually an NCNN update this version, however this is a reminder that if you haven't updated since before v0.11, you should update for this release as otherwise NCNN upscaling will not work.
  • ONNX
    • Updated the version to support python 3.10 finally (if using system python with 3.10)
    • Added another required package that will need to be installed
    • Required to convert to NCNN

New Features

  • PyTorch -> NCNN conversion & ONNX -> NCNN conversion (#721) (#845) (thanks @theflyingzamboni)
    • PyTorch models can now be converted to NCNN models.
  • ONNX interpolation (#762) (thanks @theflyingzamboni)
    • Interpolate two of the same kinds of ONNX models the same way you would with PyTorch or NCNN
  • SwinIR support (#812) (#850) (#878)
  • RAM usage optimizations (#834) (#860)
  • PyTorch optimizations (#863) (#871)
  • Added a warning when modifying the chain during an execution (#843)
  • PyTorch model file iterator (#877)
    • Iterate through a directory and load every .pth model in it, like you would an image file iterator.
  • Add toggle for checking for an update on startup (#875) (thanks @jumpyjacko)
  • Node execution times now display on the bottom right corner of nodes (#882)

Change to Existing Features

  • "Tile Size Target" input changed to "Number of Tiles" (#720)
    • I found that the previous "Tile Size Target" was not clear about what it does or that there was auto tiling involved. Now it has been changed to a dropdown with a default "Auto" setting.
  • All string inputs now accept number inputs (#853)
  • Iterator indexes are now number outputs (#854)
  • Changed the NCNN icon to reflect their actual logo (#868)
  • Added favorites to the node selection context menu (#881)

New Nodes

  • Canny Edge Detection node (#869) (thanks @jumpyjacko)
    • Run edge detection on an image
  • (ONNX) Convert to NCNN
  • (PyTorch) Convert to NCNN
  • (PyTorch) Model File Iterator

Bug Fixes

  • Fixed backend not closing on exit on macOS (#879)
  • Fixed bugs with grayscale image upscaling (#829) (#842) (thanks @theflyingzamboni)
  • Fixed viewport position & zoom not loading properly in certain scenarios (#870)
  • Fixed iterator resuming after pausing (#884)
  • Fixed Blend node bugs (#887) (thanks @theflyingzamboni)