diff --git a/brushnet_nodes.py b/brushnet_nodes.py index b07f960..6e2ec5a 100644 --- a/brushnet_nodes.py +++ b/brushnet_nodes.py @@ -773,8 +773,8 @@ def brushnet_inference(x, timesteps, transformer_options): npe = bo['negative_prompt_embeds'] ppe, nppe, time_ids = bo['add_embeds'] - do_classifier_free_guidance = mp['free_guidance'] - #do_classifier_free_guidance = len(transformer_options['cond_or_uncond']) > 1 + #do_classifier_free_guidance = mp['free_guidance'] + do_classifier_free_guidance = len(transformer_options['cond_or_uncond']) > 1 x = x.detach().clone() x = x.to(torch_dtype).to(brushnet.device) @@ -788,7 +788,7 @@ def brushnet_inference(x, timesteps, transformer_options): added_cond_kwargs = {} if do_classifier_free_guidance and step == 0: - print('BrushNet inference: do_classifier_free_guidance is True', len(transformer_options['cond_or_uncond']) > 1) + print('BrushNet inference: do_classifier_free_guidance is True') sub_idx = None if 'ad_params' in transformer_options and 'sub_idxs' in transformer_options['ad_params']: diff --git a/model_patch.py b/model_patch.py index 2c7e497..8dde60d 100644 --- a/model_patch.py +++ b/model_patch.py @@ -102,11 +102,11 @@ def modified_sample(model, noise, positive, negative, cfg, device, sampler, sigm # to = add_model_patch_option(model) to['model_patch']['all_sigmas'] = sigmas - - if math.isclose(cfg, 1.0) and model_options.get("disable_cfg1_optimization", False) == False: - to['model_patch']['free_guidance'] = False - else: - to['model_patch']['free_guidance'] = True + # + #if math.isclose(cfg, 1.0) and model_options.get("disable_cfg1_optimization", False) == False: + # to['model_patch']['free_guidance'] = False + #else: + # to['model_patch']['free_guidance'] = True # #######################################################################################