Open SagsMug opened 1 year ago
@SagsMug any luck with this? Getting the same error rn
@SagsMug any luck with this? Getting the same error rn
I believe this was a sampler issue, so you could try switching to a different one I just used it without upscaling
Same issue
we run into the same error here, when we are using 'DPM++ SDE Karras' as sampler in an api call (txt2img).
try to add "hr_sampler_name": "DPM++ SDE Karras" in the api request body. fixed it for me
@markogeissler Thanks for your guide. I just tried it, no luck...but with more error details compared to previous version (still the same error, my sd release now, is 1.3.2) What release are you using? can you share your api request body? or will it help if I reinstall the sampler?
"hr_upscaler": "Latent", "hr_resize_x": 1024, "hr_resize_y": 1024, "hr_sampler_name": "DPM++ SDE Karras", "denoising_strength": 0.7
these are the options i have set for hr
On a new installation (version 1.3.2, python 3.10.11, ubuntu), I tried it again with below request payload when posting them to sdapi/v1/txt2img:
payload = {
"enable_hr": True,
"hr_scale": 2,
"hr_upscaler": "R-ESRGAN 4x+",
"hr_second_pass_steps": 0.35,
"hr_resize_x": 1536,
"hr_resize_y": 1536,
"hr_sampler_name": "DPM++ SDE Karras",
"prompt": "1girl, stars",
"styles": [
""
],
"batch_size": 1,
"n_iter": 1,
"steps": 30,
"cfg_scale": 12,
"width": 768,
"height": 768,
"override_settings": {},
"override_settings_restore_afterwards": True,
"send_images": True,
"save_images": True,
}
response = requests.post(url=f'{url}/sdapi/v1/txt2img', json=payload)
print(response.json())
The error is still here:
/home/aihikes/zoo/stable-diffusion-webui/modules/sd_samplers_kdiffusion.py:315 in create_noise_sampler
314 from k_diffusion.sampling import BrownianTreeNoiseSampler
❱ 315 sigma_min, sigma_max = sigmas[sigmas > 0].min(),sigmas.max()
316 current_iter_seeds = p.all_seeds[p.iteration * p.batch_size:(p.iteration + 1) *
BrownianTreeNoiseSampler = <class 'k_diffusion.sampling.BrownianTreeNoiseSampler'>
p = <modules.processing.StableDiffusionProcessingTxt2Img object at 0x7f3f42e10ee0>
self = <modules.sd_samplers_kdiffusion.KDiffusionSampler object at 0x7f3f385d5e70>
sigmas = tensor([0.], device='cuda:0')
RuntimeError: min(): Expected reduction dim to be specified for input.numel() == 0. Specify the reduction dim with the 'dim' argument.
update: I found that, in class KDiffusionSampler, its get_sigmas(self, p, steps) method returns sigmas as: tensor([0.], device='cuda:0'), and this empty tensor would cause sigmas[sigmas > 0].min() to throw runtime error. Can I assume this might be a bug about k-diffusion?
Solution: NEED to add denoising_strength in your request body. A request without it will make an empty tensor, causing runtime error. Thank you! @markogeissler
Just adding to the knowledge. I did everything, then realized I had denoising set to 0. Changed that to .1 and it worked.
I have the same error. I tried all possible permutations. As soon as I set enable_hr : true an error is triggered. My payload is:
const result = await sdApi.txt2img({
prompt: prompt,
// "negative_prompt": "realistic, easynegative, badhandv4, disfigured, deformed, extra limbs, close up, b&w, blurry",
width:96,
height:96,
override_settings: {
sd_model_checkpoint: models[0],
// enable_hr: true,
},
"denoising_strength": 0.5,
hr_sampler_name: "DPM++ SDE Karras",
enable_hr: true,
hr_upscaler: "ESRGAN_4x",
hr_scale: 2,
// hr_resize_x: 300,
// hr_resize_y:300,
hr_second_pass_steps: 10,
sampler_index: "DPM++ SDE Karras",
restore_faces: false,
});
if enable_hr:false everything works but no upscaling. Any suggestion?
Is there an existing issue for this?
What happened?
When i try to use the
/sdapi/v1/txt2img
endpoint with"enable_hr": True
SDW casts an exception at the end of generationSteps to reproduce the problem
Run:
What should have happened?
It should return the generated images in a json message
Commit where the problem happens
Im running the latest commit 0cc0ee1
What platforms do you use to access the UI ?
Linux
What browsers do you use to access the UI ?
Mozilla Firefox
Command Line Arguments
List of extensions
deforum-for-automatic1111-webui novelai-2-local-prompt sd-civitai-browser stable-diffusion-webui-inspiration LDSR Lora ScuNET SwinIR prompt-bracket-checker
Console logs
Additional information
I run this through WSL2 and have attempted to update libraries with
pip install -r requirements --upgrade
which didnt fix the problem