Skip to content

Commit

Permalink
pulid fix seed
Browse files Browse the repository at this point in the history
Signed-off-by: Vladimir Mandic <[email protected]>
  • Loading branch information
vladmandic committed Nov 8, 2024
1 parent 882a580 commit 79f96fb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions modules/processing_args.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,8 @@ def set_pipeline_args(p, model, prompts: list, negative_prompts: list, prompts_2
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:
args['seed'] = p.seed
if 'noise_sampler_seed' in possible:
args['noise_sampler_seed'] = p.seeds
if 'guidance_scale' in possible:
Expand Down
2 changes: 1 addition & 1 deletion scripts/pulid_ext.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,10 @@ def run(self, p: processing.StableDiffusionProcessing, strength: float = 0.8, ze
shared.sd_model.debug_img_list = []
uncond_id_embedding, id_embedding = shared.sd_model.get_id_embedding(images)

p.seed = processing_helpers.get_fixed_seed(p.seed)
if direct: # run pipeline directly
shared.state.begin('PuLID')
processing.fix_seed(p)
p.seed = processing_helpers.get_fixed_seed(p.seed)
p.prompt = shared.prompt_styles.apply_styles_to_prompt(p.prompt, p.styles)
p.negative_prompt = shared.prompt_styles.apply_negative_styles_to_prompt(p.negative_prompt, p.styles)
with devices.inference_context():
Expand Down

0 comments on commit 79f96fb

Please sign in to comment.