diff --git a/README.md b/README.md index c3b0a19..8b13789 100644 --- a/README.md +++ b/README.md @@ -1,195 +1 @@ -# ComfyUI-RealESRGAN_Upscaler [![ComfyUI - Homepage](https://img.shields.io/badge/ComfyUI-Homepage-aa00ee)](https://github.com/comfyanonymous/ComfyUI) [![ComfyUI - Manager](https://img.shields.io/badge/ComfyUI-Manager-2aeeef)](https://github.com/ltdrdata/ComfyUI-Manager) -> [!IMPORTANT] ->

🚧 This documentation is still under -> construction. The development of the upscaler is a ongoing -> activity. There might be small differenes in comparison of -> node and documentation.

- -> [!CAUTION] ->

Please note, that the node will run, only -> if an error in one Python package file is fixed. See the -> related section for informations on this topic.

- -## Preface - -

This node uses the RealESRGAN model from -xinntao [1]. This is my personal favourite upscaling model and -upscaling approach.

- -## Prerequisites - -

What I am writing is valid for a computer on -which as the operating system Linux is installed.

- -

To run the upscaler one needs a NVIDIA graphic -card.

- -## Whats New - -

Yesterday I added a bunch of things to the node. -Now the node is a little bit more complicated than before. On the -other hand side the node considers now everything which is possible -to do with the node.

- -## Upscaling - -

One can set the scaling factor in steps of 0.1 -in the node. For the moment there is no known limit for the scaling -factor. I used for example an unrealistic scaling factor of 30.0 -for upscaling of a test image. The limiting factor is in this case -the size of the image file.

- -## Node Preview - -

Figure 1 shows the node preview. Input is an image. -Main output is the upscaled image. In addition to this one can output -the local installation with respect to the GPUs. In case of an error -the error can be printed too.

- -node preview -

Figure 1: Main node preview

- -## Node Parameter -The node has following parameter - -+ scale_factor (FLOAT) -+ tile_number (INT) -+ tile_pad (INT) -+ pre_pad (INT) -+ fp_format (STRING) -+ denoise (FLOAT) -+ netscale (INT) -+ gpu_id (LIST) -+ model (LIST) - -

For an upscaling one needs in a first shot the scale -factor and a model. The other parameter can be as they are. For a -resolution of the image of 512 x 512 pixel this is in general valid.

- -Over the gpu_id the user can decide, which GPU should be used for the upscaling. - -Depending on the hardware one needs the tiling. In my case I needs tiling -for a resolution of 1024 upwards. - -## Model Selection - -model selection -

Figure 2: Model selection

- -## What the Node Does - -The node can upscale images which have following formats - -- JPG/JPEG -- PNG -- WEBP - -## Workflow Preview - -Figure 3 shows the example workflow preview. - -node preview -

Figure 3: Workflow preview

- -Figure 4 shows the example workflow preview. - -node preview -

Figure 4: Workflow preview

- -## Installation - -

Use the ComfyUI Manager for the installation. -Use my nick 'zentrocdot' or for 'ComfyUI_realESRGAN_Upscaler'

- -## Known Problems - -While first run I got an error message that the installation -of the node failed. After first investigation I found the -problem. Fix for the moment is as follows. Go into directory -ComfyUI. Then search for a file. - -find -name "degradations.py" - -This looks like. - -./venv/lib/python3.10/site-packages/basicsr/data/degradations.py - -Open the file e.g. - -nano ./venv/lib/python3.10/site-packages/basicsr/data/degradations.py - -and change - -from torchvision.transforms.functional_tensor import rgb_to_grayscale - -to - -from torchvision.transforms.functional import rgb_to_grayscale - -After that, the node will work. - -## Bug Fixing - -in the directory is a file called fix.bash. This can be used to fix -the bug in the Python package. - -## Error Screen - -While working on the node I have also provoked errors for testing purposes. -When the number of netscale is not matching the value of the model's -netscale one got an error. - -![Bildschirmfoto vom 2025-02-09 08-57-01](https://github.com/user-attachments/assets/03771469-3a59-4115-baba-a362b60d20fb) - -

Figure 5: Error message preview

- -

The error led to unexpected behaviour of the node. -This was the reason to rethink the programming. Now I catch the error -Over the output ERROR one can make such an error visible. To prevent -misleading results the output is an empty image with text.

- -## Limitations - -Limitation at the moment not known. - -## To-Do - -

There are a plenty of things to to

- -## Example Using Converted Models - -

Figure 6 and Figure 7 show two examples where -I used two converted models for the upscaling. it depends on your -personal taste which upscaler you like.

- -![ultrasharp](https://github.com/user-attachments/assets/60d7e2ff-53d4-48b8-96a8-5f42fcf01868) - -

Figure 6: Upscaling using 4x-UltraSharp.pth

- -![nomos](https://github.com/user-attachments/assets/1d0305f3-d8e9-4e75-98f0-3fbe593d18b6) - -

Figure 7: Upscaling using 4xNomos8kSC.pth

- -## Credits - -

Special credits goes to xinntao (Xintao Wang) for his excellent -work on ESRGAN and RealESRGAN models The results achieved are quite impressive.

- -## Final Words - -Have fun. Be inspired! - -# Reference - -[1] https://github.com/xinntao/Real-ESRGAN - -[2] https://github.com/xinntao/Real-ESRGAN/blob/master/docs/model_zoo.md - -[3] https://arxiv.org/abs/2107.10833 - -[4] https://github.com/zentrocdot/ESRGAN_RRBD_CONVERTER - -[5] https://github.com/ltdrdata/ComfyUI-Manager - -[6] https://openmodeldb.info/