mirror of
https://github.com/vladmandic/automatic
synced 2026-09-18 16:54:33 +02:00
fix(model): tolerate empty prompts on minimax h3
An empty prompt tokenizes to zero tokens and the conditioner fails reshaping an empty sequence; a single space keeps the generate-on-empty behavior other models have.
This commit is contained in:
@@ -328,6 +328,8 @@ def set_pipeline_args(p, model, prompts:list, negative_prompts:list, prompts_2:l
|
||||
if 'MiniMaxH3' in model.__class__.__name__:
|
||||
if isinstance(args.get('prompt', None), list): # packs one request into one sequence, str only
|
||||
args['prompt'] = args['prompt'][0] if len(args['prompt']) > 0 else ''
|
||||
if not str(args.get('prompt', '') or '').strip():
|
||||
args['prompt'] = ' ' # an empty prompt tokenizes to zero tokens, which the conditioner cannot reshape
|
||||
args.pop('negative_prompt', None) # guidance-distilled, no negative prompt
|
||||
if isinstance(args.get('generator', None), list) and len(args['generator']) > 0:
|
||||
args['generator'] = args['generator'][0] # >1-element list breaks the audio noise draw
|
||||
|
||||
Reference in New Issue
Block a user