fix sampler set timesteps vs sigmas

Signed-off-by: Vladimir Mandic <mandic00@live.com>
This commit is contained in:
Vladimir Mandic
2025-09-07 10:50:04 -04:00
parent 4989b61502
commit fbe612b2eb
3 changed files with 19 additions and 34 deletions
+4 -3
View File
@@ -1,8 +1,8 @@
# Change Log for SD.Next
## Update for 2025-09-06
## Update for 2025-09-07
### Highlights for 2025-09-06
### Highlights for 2025-09-07
*What's new*? Big one is that we're (finally) switching the default UI to **ModernUI**!
StandardUI is still available and can be selected in settings, but ModernUI is now the default for new installs
@@ -11,7 +11,7 @@ Also, there are quite a few offloading improvements and many quality-of-life cha
[ReadMe](https://github.com/vladmandic/automatic/blob/master/README.md) | [ChangeLog](https://github.com/vladmandic/automatic/blob/master/CHANGELOG.md) | [Docs](https://vladmandic.github.io/sdnext-docs/) | [WiKi](https://github.com/vladmandic/automatic/wiki) | [Discord](https://discord.com/invite/sd-next-federal-batch-inspectors-1101998836328697867)
### Details for 2025-09-06
### Details for 2025-09-07
- **Models**
- **Chroma** final versions: [Chroma1-HD](https://huggingface.co/lodestones/Chroma1-HD), [Chroma1-Base](https://huggingface.co/lodestones/Chroma1-Base) and [Chroma1-Flash](https://huggingface.co/lodestones/Chroma1-Flash)
@@ -97,6 +97,7 @@ Also, there are quite a few offloading improvements and many quality-of-life cha
- fix zluda flash attention with enable_gqa
- fix `wan a14b` quantization
- fix reprocess workflow for control with hires
- fix samplers set timesteps vs sigmas
## Update for 2025-08-20
+14 -30
View File
@@ -240,36 +240,20 @@ def set_pipeline_args(p, model, prompts:list, negative_prompts:list, prompts_2:t
else:
args['clip_skip'] = clip_skip - 1
if 'timesteps' in possible:
timesteps = re.split(',| ', shared.opts.schedulers_timesteps)
timesteps = [int(x) for x in timesteps if x.isdigit()]
if len(timesteps) > 0:
if hasattr(model.scheduler, 'set_timesteps') and "timesteps" in set(inspect.signature(model.scheduler.set_timesteps).parameters.keys()):
try:
args['timesteps'] = timesteps
p.steps = len(timesteps)
p.timesteps = timesteps
steps = p.steps
shared.log.debug(f'Sampler: steps={len(timesteps)} timesteps={timesteps}')
except Exception as e:
shared.log.error(f'Sampler timesteps: {e}')
else:
shared.log.warning(f'Sampler: cls={model.scheduler.__class__.__name__} timesteps not supported')
if 'sigmas' in possible:
sigmas = re.split(',| ', shared.opts.schedulers_timesteps)
sigmas = [float(x)/1000.0 for x in sigmas if x.isdigit()]
if len(sigmas) > 0:
if hasattr(model.scheduler, 'set_timesteps') and "sigmas" in set(inspect.signature(model.scheduler.set_timesteps).parameters.keys()):
try:
args['sigmas'] = sigmas
p.steps = len(sigmas)
p.timesteps = sigmas
steps = p.steps
shared.log.debug(f'Sampler: steps={len(sigmas)} sigmas={sigmas}')
except Exception as e:
shared.log.error(f'Sampler sigmas: {e}')
else:
shared.log.warning(f'Sampler: cls={model.scheduler.__class__.__name__} sigmas not supported')
timesteps = re.split(',| ', shared.opts.schedulers_timesteps)
if len(timesteps) > 0:
if ('timesteps' in possible) and hasattr(model.scheduler, 'set_timesteps') and ("timesteps" in set(inspect.signature(model.scheduler.set_timesteps).parameters.keys())):
p.timesteps = [int(x) for x in timesteps if x.isdigit()]
p.steps = len(timesteps)
args['timesteps'] = p.timesteps
shared.log.debug(f'Sampler: steps={len(p.timesteps)} timesteps={p.timesteps}')
elif ('sigmas' in possible) and hasattr(model.scheduler, 'set_timesteps') and ("sigmas" in set(inspect.signature(model.scheduler.set_timesteps).parameters.keys())):
p.timesteps = [float(x)/1000.0 for x in timesteps if x.isdigit()]
args['sigmas'] = p.timesteps
p.steps = len(p.timesteps)
shared.log.debug(f'Sampler: steps={len(p.timesteps)} sigmas={p.timesteps}')
else:
shared.log.warning(f'Sampler: cls={model.scheduler.__class__.__name__} timesteps not supported')
if hasattr(model, 'scheduler') and hasattr(model.scheduler, 'noise_sampler_seed') and hasattr(model.scheduler, 'noise_sampler'):
model.scheduler.noise_sampler = None # noise needs to be reset instead of using cached values