AUTOMATIC1111 / stable-diffusion-webui

Stable Diffusion web UI
GNU Affero General Public License v3.0
143.47k stars 27.01k forks source link

Seed not returned via api #16560

Closed Marcophono2 closed 1 month ago

Marcophono2 commented 1 month ago

Checklist

What happened?

Hello! When not setting a seed, a random seed is generated and correctly output in the web-gui. But the api only returns "-1". That is correctly so far, as this is the default comand to let the framework know that it shall set a random seed. But exactly that seed I need. Is there a workaround for it?

Steps to reproduce the problem

Simply use the api for generating an image, do not set a seed and print out res['parameters']

What should have happened?

the value of the random seed shall be delivered by the api

What browsers do you use to access the UI ?

Google Chrome

Sysinfo

sysinfo-2024-10-17-15-55.json

Console logs

{'prompt': 'A 30-year-old woman with middle-long brown hair and glasses is playing tennis wearing nothing but her glasses and holding a tennis racket while swinging it gracefully on an outdoor tennis court. A large tennis ball logo is prominently displayed on the court surface emphasizing the sport being played., impressive lighting', 'negative_prompt': 'nude, hands, Bokeh/DOF,flat, low contrast, oversaturated, underexposed, overexposed, blurred, noisy', 'styles': None, 'seed': -1, 'subseed': -1, 'subseed_strength': 0, 'seed_resize_from_h': -1, 'seed_resize_from_w': -1, 'sampler_name': None, 'batch_size': 1, 'n_iter': 1, 'steps': 5, 'cfg_scale': 1.5, 'width': 768, 'height': 1024, 'restore_faces': True, 'tiling': None, 'do_not_save_samples': False, 'do_not_save_grid': False, 'eta': None, 'denoising_strength': None, 's_min_uncond': None, 's_churn': None, 's_tmax': None, 's_tmin': None, 's_noise': None, 'override_settings': None, 'override_settings_restore_afterwards': True, 'refiner_checkpoint': None, 'refiner_switch_at': None, 'disable_extra_networks': False, 'comments': None, 'enable_hr': False, 'firstphase_width': 0, 'firstphase_height': 0, 'hr_scale': 2.0, 'hr_upscaler': None, 'hr_second_pass_steps': 0, 'hr_resize_x': 0, 'hr_resize_y': 0, 'hr_checkpoint_name': None, 'hr_sampler_name': None, 'hr_prompt': '', 'hr_negative_prompt': '', 'sampler_index': 'DPM++ SDE', 'script_name': None, 'script_args': [], 'send_images': True, 'save_images': False, 'alwayson_scripts': {}}

Additional information

No response

missionfloyd commented 1 month ago

Those are the input parameters. For output, check res['info'] (a JSON string; parse it with json.loads())

Marcophono2 commented 1 month ago

Ohaaaaa! Thanks a lot, @missionfloyd !