lllyasviel / lllyasviel/stable-diffusion-webui-forge
Extras -> Single Image Upscale doesn't work for some models
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 13k
- Forks
- 1.7k
- PR merge metrics
- No merged PRs in 30d
Description
Hi Team,
I'm not sure if this is just something wrong with my models but I thought to reach out. It appears the Upscale function doesn't work (Either through the UI or through API)
**Steps to Reproduce**
1. Navigate to Extras -> Single Image
2. Specify one of the following upscalers
a. DAT Models
b. ESRGAN or R-ESRGAN models
3. Load an image
4. Hit Generate
Log snippet and traceback
```
[Unload] Trying to free 1024.00 MB for cuda:0 with 0 models keep loaded ... Current free memory is 5699.35 MB ... Done.
Cleanup minimal inference memory.
tiled upscale: 100%|███████████████████████████████████████████████████████████████████| 36/36 [00:01<00:00, 22.37it/s]
Traceback (most recent call last):
File "B:\webui_forge_cu121_torch231\webui\modules\call_queue.py", line 76, in f
res = list(func(*args, **kwargs))
File "B:\webui_forge_cu121_torch231\webui\modules\call_queue.py", line 55, in f
res = func(*args, **kwargs)
File "B:\webui_forge_cu121_torch231\webui\modules\call_queue.py", line 39, in f
res = func(*args, **kwargs)
File "B:\webui_forge_cu121_torch231\webui\modules\postprocessing.py", line 135, in run_postprocessing_webui
return run_postprocessing(*args, **kwargs)
File "B:\webui_forge_cu121_torch231\webui\modules\postprocessing.py", line 76, in run_postprocessing
scripts.scripts_postproc.run(initial_pp, args)
File "B:\webui_forge_cu121_torch231\webui\modules\scripts_postprocessing.py", line 198, in run
script.process(single_image, **process_args)
File "B:\webui_forge_cu121_torch231\webui\scripts\postprocessing_upscale.py", line 152, in process
upscaled_image = self.upscale(pp.image, pp.info, upscaler1, upscale_mode, upscale_by, max_side_length, upscale_to_width, upscale_to_height, upscale_crop)
File "B:\webui_forge_cu121_torch231\webui\scripts\postprocessing_upscale.py", line 107, in upscale
image = upscaler.scaler.upscale(image, upscale_by, upscaler.data_path)
File "B:\webui_forge_cu121_torch231\webui\modules\upscaler.py", line 68, in upscale
img = self.do_upscale(img, selected_model)
File "B:\webui_forge_cu121_torch231\webui\modules\realesrgan_model.py", line 48, in do_upscale
return upscale_with_model(
File "B:\webui_forge_cu121_torch231\webui\modules\upscaler_utils.py", line 88, in upscale_with_model
return images.combine_grid(newgrid)
File "B:\webui_forge_cu121_torch231\webui\modules\images.py", line 120, in combine_grid
mask_w = make_mask_image(np.arange(grid.overlap, dtype=np.float32).reshape((1, grid.overlap)).repeat(grid.tile_h, axis=0))
TypeError: 'float' object cannot be interpreted as an integer
'float' object cannot be interpreted as an integer
```
The models tested work on the original A111 UI.
This seems to be just a small type error. I would try to fix this myself but I'm not too familiar with python and the codebase.
I can provide more information if it helps.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in modules/images.py at combine_grid, then trace the call from modules/upscaler_utils.py through modules/realesrgan_model.py. Reproduce Single Image upscaling with a DAT or ESRGAN model through the UI or API, and verify that generation completes without the reported TypeError.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- computer-vision
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 48/100