Dramatically reduce render times with AI Upscaler for Blender

12 Likes

Interesting, potentially really cool stuff. Can you talk a bit more about it and how it’s achieving what it does? Is this comparable to something like Topaz Labs? Does it work well with animation?

1 Like

Yep it’s similar to Topaz Upscaler https://www.topazlabs.com/gigapixel-ai

Blender renders at a lower resolution and the image is upscaled to the final resolution.

AI Upscaler for Blender is free and works as a Blender addon. The upscaling happens on the local machine and nothing is sent over the web.

The upscaler itself is Real-ESRGAN which is an open source upscaler.

5 Likes

First of all, THANK YOU.
Second of all my initial suspicion was…is it temporal resistance ?

Explanation: A.I denoiser/whatever-next-level-cool shit denoiser is always celebrated…until it starts to render animation…it is only then that you realize it totally breaks down, details pooping in and out for example.
So much so that temporal denoiser is much soar after than just “any” denoiser that supposedly does a better job for single images.

Now I wonder about this same thing for this, I look forward to using it during actual production someday to find out.

If it works, it will be amazing, we’re talking about a four fold render speed increase, this is a very big deal.

Again, thank you !!!

1 Like

Anything that renders at a low scale and then upscales will have inconsistent detail, including this. I think this would probably work very well for still shots but I highly doubt it’ll work for animation

4 Likes

Animation should be possible. I’ll look into it for v2 of the plugin. v1 only supports still images.

The upscaler used by the plugin Real-ESRGAN has a version meant for anime video: https://github.com/xinntao/Real-ESRGAN/blob/master/docs/anime_video_model.md

4 Likes

Very cool! I’m looking forward to testing it.

A lot of my images have very small noise-based texture details, which usually requires rendering large so they come through. I’m interested in seeing if these details get retained and emphasized when upscaled.


UPDATE: I gave it a try, and here are the results:

Mac laptop w/ no GPU
1080 x 1080
16-bit PNG (versions posted are ImageOptim compressed)

AI Upscaler - Scale Factor 4

About 1 Minute – 5.1mb

AI Upscaler - Scale Factor 2

About 6 minutes – 5.0mb

Full Rez Blender Render

About 3 minutes - 3.6mb

Full Rez Blender Render has better detail and faster render, and smaller file size suggests less image noise as well.

But aside from the loss of texture details, the AI Upscaler - Scale Factor 2 is a really nice image. And if I was going up to 4k, I have a feeling it would hold the details well. And perhaps AI upscaling to 4k might be faster than Blender render as well?

2 Likes

Hmm…nice test, really helps to see the difference.
Yeah details are definitely lost and no one is acting surprised here, I guess we are all hoping for A.I voodoo magic ;p
This tool can be useful to render 4K from 2K, definitely using this for that route when crushed for time but again thanks for the test, now I wouldn’t be expecting miracles from this but useful :smiley:

3 Likes

Details will always be lost with those methods for the simple reason that there are many potential solutions. Those methods are built to hopefully pick reasonable ones. The goal in a sense is that if you look at it for a moment, it looks legit. But as soon as you pick up a magnifying glass, you are going to figure out that an upscaler was at work.
In my opinion the true potential for those techniques is in animations, because the viewer won’t inspect every single frame while watching.

3 Likes

Have you looked into other “models”?
For example https://github.com/xinntao/Real-ESRGAN
or https://github.com/AaronFeng753/Waifu2x-Extension-GUI?
I mostly use first one (“lighter”, faster and results seem better (to me).

PS
Comparison video:

1 Like

What train data this uses?

I’ve actually planned to test AI denoising+rescaling tool because it should be trivial to render using Cycles extremely high amount of samples as ground truth and give low sample/resolution as input.

what I thought, I’m not sure is there any benefit to render lower resolution. Why just not use 1/4 of samples and double resolution horizontally and vertically?

What I mean is that If we got got 3840x2160 at 256 samples, same amount of samples are calculated at 1920x1080 at 1024, and 960x540 at 4096, and 480x270 at 16384.

How about if dropping samples 1/4 and half horizontal and vertical resolution before sending rescaling/denoiser?

The real trick is denoiser there.

In my opionion, I don’t think that AI rescaling does not alone give much benefits. AI should work by having input of samples shoot in animation given time (random seed) and reconstruct frames. Fast moving things get less samples then as slow motion get more samples during multiple frames.

So lower resolution is of course possible and could be easily good thing while information is encoded to 32-bit floats. There is likely more information preserved if samples are shoot target resolution, image tile is resampled to lower resolution and then reconstruct again using all temporal and spatial information there is.

1 Like

Agree, the true strength is in animation…which is rather ironic that the first implementation for this add-on is for still image only but @jarrellmark has mentioned that he is looking into it, go up a few post to see his reply.

3 Likes

I’ve been using esrgan for a while to upscale stills by a factor of x1.5-2 and I’ve found that different models have different advantages with the best result coming from interpolating between 2 or 3 models. I just tested a render of mine and I’m curious wether other people use different models, but I can recommend trying Uniscale v2 and countryroads.

3 Likes

Hi @jarrellmark :wave:
I tried the add-on with Blender 3.2.2 but I got an error each time I clicked on “Render and Upscale” :
Set 'Output path' to an existing folder.

This error appears if, in the path, there are spaces in some folders names.
I fixed this error by replacing spaces with underscores _

EDIT: so I thought this solved the error. It seems that saving the .blend file prior to render might have fixed it.


On a side note, perhaps, you might want to complete the bl_info paragraph in the __init.py__ file:

bl_info = {
    "name": "AI Upscaler for Blender",
    "description": "AI Upscaler for Blender using Real-ESRGAN.",
    "author": "Mark Jarrel",
    "version": (1, 0, 1),
    "blender": (2, 93, 0),
    "location": "Output Properties tab > AI Upcaler",
    "doc_url": "https://blenderartists.org/t/dramatically-reduce-render-times-with-ai-upscaler-for-blender/1397593/", 
    "tracker_url": "https://github.com/jarrellmark/ai_upscaler_for_blender/",
}
1 Like

Just a few tests (all images are .webp files, at 90% quality) with a Nvidia GTX 1070.

1920x1080 - Blender render 400 samples - OpenImageDenoise - 6min28 :

1920x1080 - AI Upscaler - scale factor 2 - 4min12 :

1920x1080 - AI Upscaler - scale factor 4 - 1min13 :

4 Likes

It’s heartwarming to see you all trying the plugin and providing your feedback and results. Thanks very much.

Main takeaways seem to be:

  • Animation could be a more useful than still images because any lack of detail would be less noticeable.
  • 4k as a target resolution would provide better results than 1080 HD as a target resolution.

Would be great if anyone could try some scenes at 4k (3840 x 2160 for 16:9 ratio) with scale factor of 2. I’d expect really good results here because Blender would render images in 1080p. There should be enough detail in the 1080p images to upscale to 4k.

In the meantime I’ll prioritize adding animation support for the next version of the addon.

3 Likes

Nice initiative. I’ve been using ESRGAN for years. Real-ESRGAN is great too, but there are lots of specialized ESRGAN models that work best for specific cases, such as anime models that could be used for NPR renderings. You might want to include a selection of those models as options in a drop-down menu, maybe as a separate download, as the model .pth files have a relatively large file size.

1 Like

Still using a Nvidia GTX 1070.

3840x2160 - Blender render 400 samples - Intel Denoiser - 24min26 :

3840x2160 - AI Upscaler - scale factor 2 - 33min27 (during the last third of the rendering process, my computer started to seriously hang, without freezing completely) :

Upscaled looks very airbrushed, especially with the cobwebs and the wood grain :thinking:

3 Likes

At first sight, what I noticed on the Upscaled render:

  • the textures of the drawers (on the left) look a bit “washed out” but edges seem to be sharper (but so are all furnitures, overall):
    page1

  • the metallic grid looks less conform to the original image but in another hand… looks less “3Dish”. The color of the wicker basket clearly doesn’t match (it’s darker)

  • Some ground tiles have another color tone on the Upscaled render:

2 Likes