Closed mart-hill closed 1 year ago
i haven't seen this issue before, but fix seems to be easy. fixed.
This happened just on this commit, the previous one was fine. I'll test it ASAP! :) BTW, I like how you fixed the pixelated output of the second-pass images, when the denoise is set at low value, like 0.35, and the upscaler is a 'Latent' one. The images are all nice and sharp now. Previously, to alleviate that, I was using ERSGAN scalers.🙂
thats really strange as there were pretty much zero changes anywhere near that code.
That's really interesting. Would that be one of the add-ons? I didn't see any changes at the start-up with numpy
though.
ah, i got it. missing default value for new experimental setting -> optimizations -> torch inference mode
Sorry, that I'm finding such obscure bugs and make more work for you... 🙂
naah, better you than someone else! but yeah, you're fast! 🥇
I noticed one strange thing about ERSGAN upscalers use in second pass after the numpy fix - the second pass doesn't actually kick in at all! It's just the "raw" upscale (I set it at x2) that takes place now. Look, I have 40 steps for first pass, and 20 for the second, and this was the first generated image after a startup (I "unlocked" the options the UI hides as default, of course). 🙂
100%|██████████████████████████████████████████████████████████████████████████████████████████████████████| 40/40 [00:08<00:00, 4.50it/s]
Loading CLiP model ViT-L/14
02:03:14-335446 INFO Processed: images=1 time=40.10s its=1.00 memory={'ram': {'used': 7.79, 'total': 63.68}, 'gpu': {'used': 4.77,
'total': 24.0}, 'retries': 0, 'oom': 0}
Latent upscalers do initiate the second pass correctly (something is choking the VRAM in VAE phase, it's probably --no-half-vae):
100%|██████████████████████████████████████████████████████████████████████████████████████████████████████| 40/40 [00:06<00:00, 6.26it/s]
100%|██████████████████████████████████████████████████████████████████████████████████████████████████████| 20/20 [00:20<00:00, 1.03s/it]
02:04:32-472946 INFO GPU high memory utilization: 100% {'ram': {'used': 10.23, 'total': 63.68}, 'gpu': {'used': 24.0, 'total': 24.0},
'retries': 0, 'oom': 0}
02:04:37-233946 INFO Processed: images=1 time=39.16s its=1.02 memory={'ram': {'used': 6.76, 'total': 63.68}, 'gpu': {'used': 3.89,
'total': 24.0}, 'retries': 0, 'oom': 0}
Edit: Oh. Maybe because of that? I had 'no-grad' checked, when inference mode option was first introduced.🙂
I noticed one strange thing about ERSGAN upscalers use in second pass after the numpy fix - the second pass doesn't actually kick in at all!
that is intentional, i just made that change. nothing to do with inference mode. if you've selected latent upscale, you'll use hires. if you're selected some standalone upscaler, then its exactly what you selected and hires should not kick in. i understand that is change in behavior, but what is the point of running something like esrgan+hires.
Could you restore the functionality with ERSGAN, where hires also works, like before? It's actually vital for very much every generation (not only) I do. The quality of the hires-ed images treated with ERSGAN model 4x_RealisticRescaler_100000_G
or 4x_foolhardy_Remacri
is better, than even with latent method, I think.🙂
For "raw" upscaling i would use either Topaz Photo AI (upscaler part, very good), or the Process tab. Pretty please? That's a HUGE change in behavior, and I'm sure it'll cause an uproar - many models rely on ERSGAN hires-ing, even if subtle with low 'denoise' value. Would it be possible to set it as optional in settings? :)
i'll add "force hires" checkbox that runs hires regardless of upscaler. but hires was designed to work with latent upscaler only, the rest is who-knows-what.
Thank you 🙂 Actutally, you can tell that I didn't know about it, and I used these two mentioned ERSGAN models practically every time with hires option, especially when I noticed pixelated outputs with low 'denoise' value (when I didn't want drastic changes to the hires-ed image, because 'basic' image was fine already) in A1111's (and yours and UX forks) while using latent upscalers back in the day.
Would this also change how the metadata from the image are "pasted" back to the txt2img or img2img? Because, now, hi-res would be ignored for practically every image I generated till now (because of hires+ERSGAN), I wonder if that part would ever be "pasted back" into the appropriate fields... 🙂
new hires logic is now live, check it out. details in changelog.
Thank you, gotta do it ASAP! I also got an Intel ARC, so I could test things on a separate machine :)
It works! Thank you. 🙂 There's a bit of "latency" between what's already done, and what's the progress bar in the UI and in the shell is showing - is that because of Gradio changes? Loading model also doesn't show progress bar while at it and while calculating the checksum, the bar just pops in when it's done. :)
loading model which progress bar? which model type? you need to be more specific.
Oh, sorry, just loading "original backend" model (not the VAE or the refiner, I didn't test the diffusers pipeline yet), which is yet to be checksum-ed, or when I change the model - the progress bar while calculating the checksum now just pops in after it ends. :) I think the similar thing happens now with progress bar while rendering UniPC-sampled image. All progress bars I'm mentioning, are in the PowerShell. But the UI one also behaves a bit different now (when there's second pass used and the second sampler is UniPC).
i cannot reproduce command line progress bar issues when using ms terminal. regarding browser progress bar, yeah, there are some tweaks needed there, but not highest priority.
That's okay, it's just a very minor quirk :)
Issue Description
This happens as soon as I generate an image as first pass gets finished (second pass uses ERSGAN scaler selected [latent ones seems to be fine]). Enqueue is also influenced by this bug.
RuntimeError: Can't call numpy() on Tensor that requires grad. Use tensor.detach().numpy() instead.
This generation error was after using the ⇦ button though, I just enabled all the additional views in the UI ('Batch' 'Seed details' 'Advanced' 'Second pass') to actually fully use the previous generation params.Version Platform Description
Relevant log output
Backend
Original
Model
SD 1.5
Acknowledgements