mirror of
https://github.com/vladmandic/automatic
synced 2026-09-11 07:18:44 +02:00
video tab major update
Signed-off-by: Vladimir Mandic <mandic00@live.com>
This commit is contained in:
@@ -26,7 +26,7 @@ def task_specific_kwargs(p, model):
|
||||
p.init_images = [helpers.decode_base64_to_image(i, quiet=True) for i in p.init_images]
|
||||
if isinstance(p.init_images[0], Image.Image):
|
||||
p.init_images = [i.convert('RGB') if i.mode != 'RGB' else i for i in p.init_images if i is not None]
|
||||
if (sd_models.get_diffusers_task(model) == sd_models.DiffusersTaskType.TEXT_2_IMAGE or len(getattr(p, 'init_images', [])) == 0) and not is_img2img_model:
|
||||
if (sd_models.get_diffusers_task(model) == sd_models.DiffusersTaskType.TEXT_2_IMAGE or len(getattr(p, 'init_images', [])) == 0) and not is_img2img_model and 'video' not in p.ops:
|
||||
p.ops.append('txt2img')
|
||||
if hasattr(p, 'width') and hasattr(p, 'height'):
|
||||
task_args = {
|
||||
@@ -238,13 +238,13 @@ def set_pipeline_args(p, model, prompts:list, negative_prompts:list, prompts_2:t
|
||||
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
|
||||
model.scheduler.noise_sampler_seed = p.seeds # some schedulers have internal noise generator and do not use pipeline generator
|
||||
if 'seed' in possible:
|
||||
if 'seed' in possible and p.seed is not None:
|
||||
args['seed'] = p.seed
|
||||
if 'noise_sampler_seed' in possible:
|
||||
if 'noise_sampler_seed' in possible and p.seeds is not None:
|
||||
args['noise_sampler_seed'] = p.seeds
|
||||
if 'guidance_scale' in possible:
|
||||
if 'guidance_scale' in possible and p.cfg_scale is not None and p.cfg_scale > 0:
|
||||
args['guidance_scale'] = p.cfg_scale
|
||||
if 'img_guidance_scale' in possible and hasattr(p, 'image_cfg_scale'):
|
||||
if 'img_guidance_scale' in possible and hasattr(p, 'image_cfg_scale') and p.image_cfg_scale is not None and p.image_cfg_scale > 0:
|
||||
args['img_guidance_scale'] = p.image_cfg_scale
|
||||
if 'generator' in possible:
|
||||
generator = get_generator(p)
|
||||
@@ -304,9 +304,10 @@ def set_pipeline_args(p, model, prompts:list, negative_prompts:list, prompts_2:t
|
||||
# handle remaining args
|
||||
for arg in kwargs:
|
||||
if arg in possible: # add kwargs
|
||||
if type(kwargs[arg]) == float or type(kwargs[arg]) == int:
|
||||
if kwargs[arg] <= -1: # skip -1 as default value
|
||||
continue
|
||||
args[arg] = kwargs[arg]
|
||||
else:
|
||||
pass
|
||||
|
||||
task_kwargs = task_specific_kwargs(p, model)
|
||||
for arg in task_kwargs:
|
||||
|
||||
Reference in New Issue
Block a user