ssitu / ComfyUI_fabric

ComfyUI nodes based on the paper "FABRIC: Personalizing Diffusion Models with Iterative Feedback" (Feedback via Attention-Based Reference Image Conditioning)
GNU General Public License v3.0
86 stars 6 forks source link

[KSamplerFABRIC] 'BaseModel' object has no attribute 'get_model_object' #27

Closed renwerx closed 6 months ago

renwerx commented 7 months ago

Clicked "update all" before I went to bed last night now I'm getting this:

Error occurred when executing KSamplerFABRIC:

'BaseModel' object has no attribute 'get_model_object'

File "K:\Programs\ComfyUI\execution.py", line 151, in recursive_execute output_data, output_ui = get_output_data(obj, input_data_all) File "K:\Programs\ComfyUI\execution.py", line 81, in get_output_data return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True) File "K:\Programs\ComfyUI\execution.py", line 74, in map_node_over_list results.append(getattr(obj, func)(slice_dict(input_data_all, i))) File "K:\Programs\ComfyUI\custom_nodes\ComfyUI_fabric\nodes.py", line 181, in sample return KSamplerFABRICAdv().sample(*args, *kwargs) File "K:\Programs\ComfyUI\custom_nodes\ComfyUI_fabric\nodes.py", line 138, in sample return fabric_sample(args, kwargs) File "K:\Programs\ComfyUI\custom_nodes\ComfyUI_fabric\fabric\fabric.py", line 42, in fabric_sample timesteps = get_timesteps(model, steps, sampler_name, scheduler, denoise) File "K:\Programs\ComfyUI\custom_nodes\ComfyUI_fabric\fabric\unet.py", line 50, in get_timesteps sampler = comfy.samplers.KSampler( File "K:\Programs\ComfyUI\comfy\samplers.py", line 705, in init self.set_steps(steps, denoise) File "K:\Programs\ComfyUI\comfy\samplers.py", line 726, in set_steps self.sigmas = self.calculate_sigmas(steps).to(self.device) File "K:\Programs\ComfyUI\comfy\samplers.py", line 717, in calculate_sigmas sigmas = calculate_sigmas(self.model.get_model_object("model_sampling"), self.scheduler, steps) File "K:\Programs\python\3.10.6\lib\site-packages\torch\nn\modules\module.py", line 1688, in getattr raise AttributeError(f"'{type(self).name}' object has no attribute '{name}'")

ssitu commented 7 months ago

Probably an update to comfyui. You'll have to downgrade or wait until I'm able to get to it.

renwerx commented 7 months ago

Not a problem, thanks for the prompt reply and for the node set itself. I'll workaround and keep watching this thread. Cheers.

954114865 commented 6 months ago

same here

ssitu commented 6 months ago

Should be fixed now

renwerx commented 6 months ago

Thanks for that! I updated all and it is working fine with 1.5 however XL throws the following (workflow included below):

Error occurred when executing KSamplerFABRIC:

File "K:\Programs\ComfyUI\execution.py", line 151, in recursive_execute output_data, output_ui = get_output_data(obj, input_data_all) File "K:\Programs\ComfyUI\execution.py", line 81, in get_output_data return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True) File "K:\Programs\ComfyUI\execution.py", line 74, in map_node_over_list results.append(getattr(obj, func)(slice_dict(input_data_all, i))) File "K:\Programs\ComfyUI\custom_nodes\ComfyUI_fabric\nodes.py", line 181, in sample return KSamplerFABRICAdv().sample(*args, *kwargs) File "K:\Programs\ComfyUI\custom_nodes\ComfyUI_fabric\nodes.py", line 138, in sample return fabric_sample(args, kwargs) File "K:\Programs\ComfyUI\custom_nodes\ComfyUI_fabric\fabric\fabric.py", line 52, in fabric_sample samples = KSamplerAdvanced().sample(model_patched, add_noise, noise_seed, steps, cfg, sampler_name, scheduler, positive, File "K:\Programs\ComfyUI\nodes.py", line 1378, in sample return common_ksampler(model, noise_seed, steps, cfg, sampler_name, scheduler, positive, negative, latent_image, denoise=denoise, disable_noise=disable_noise, start_step=start_at_step, last_step=end_at_step, force_full_denoise=force_full_denoise) File "K:\Programs\ComfyUI\nodes.py", line 1314, in common_ksampler samples = comfy.sample.sample(model, noise, steps, cfg, sampler_name, scheduler, positive, negative, latent_image, File "K:\Programs\ComfyUI\custom_nodes\ComfyUI-Impact-Pack\modules\impact\sample_error_enhancer.py", line 9, in informative_sample return original_sample(*args, kwargs) # This code helps interpret error messages that occur within exceptions but does not have any impact on other operations. File "K:\Programs\ComfyUI\custom_nodes\ComfyUI-AnimateDiff-Evolved\animatediff\sampling.py", line 313, in motion_sample return orig_comfy_sample(model, noise, *args, *kwargs) File "K:\Programs\ComfyUI\custom_nodes\ComfyUI-Advanced-ControlNet\adv_control\control_reference.py", line 47, in refcn_sample return orig_comfy_sample(model, args, kwargs) File "K:\Programs\ComfyUI\comfy\sample.py", line 37, in sample samples = sampler.sample(noise, positive, negative, cfg=cfg, latent_image=latent_image, start_step=start_step, last_step=last_step, force_full_denoise=force_full_denoise, denoise_mask=noise_mask, sigmas=sigmas, callback=callback, disable_pbar=disable_pbar, seed=seed) File "K:\Programs\ComfyUI\comfy\samplers.py", line 761, in sample return sample(self.model, noise, positive, negative, cfg, self.device, sampler, sigmas, self.model_options, latent_image=latent_image, denoise_mask=denoise_mask, callback=callback, disable_pbar=disable_pbar, seed=seed) File "K:\Programs\ComfyUI\comfy\samplers.py", line 663, in sample return cfg_guider.sample(noise, latent_image, sampler, sigmas, denoise_mask, callback, disable_pbar, seed) File "K:\Programs\ComfyUI\comfy\samplers.py", line 650, in sample output = self.inner_sample(noise, latent_image, device, sampler, sigmas, denoise_mask, callback, disable_pbar, seed) File "K:\Programs\ComfyUI\comfy\samplers.py", line 629, in inner_sample samples = sampler.sample(self, sigmas, extra_args, callback, noise, latent_image, denoise_mask, disable_pbar) File "K:\Programs\ComfyUI\comfy\samplers.py", line 534, in sample samples = self.sampler_function(model_k, noise, sigmas, extra_args=extra_args, callback=k_callback, disable=disable_pbar, self.extra_options) File "K:\Programs\python\3.10.6\lib\site-packages\torch\utils_contextlib.py", line 115, in decorate_context return func(*args, *kwargs) File "K:\Programs\ComfyUI\comfy\k_diffusion\sampling.py", line 715, in sample_dpmpp_2m_sde_gpu return sample_dpmpp_2m_sde(model, x, sigmas, extra_args=extra_args, callback=callback, disable=disable, eta=eta, s_noise=s_noise, noise_sampler=noise_sampler, solver_type=solver_type) File "K:\Programs\python\3.10.6\lib\site-packages\torch\utils_contextlib.py", line 115, in decorate_context return func(args, kwargs) File "K:\Programs\ComfyUI\comfy\k_diffusion\sampling.py", line 618, in sample_dpmpp_2m_sde denoised = model(x, sigmas[i] * s_in, extra_args) File "K:\Programs\ComfyUI\comfy\samplers.py", line 272, in call out = self.inner_model(x, sigma, model_options=model_options, seed=seed) File "K:\Programs\ComfyUI\comfy\samplers.py", line 616, in call return self.predict_noise(*args, kwargs) File "K:\Programs\ComfyUI\comfy\samplers.py", line 619, in predict_noise return sampling_function(self.inner_model, x, timestep, self.conds.get("negative", None), self.conds.get("positive", None), self.cfg, model_options=model_options, seed=seed) File "K:\Programs\ComfyUI\comfy\samplers.py", line 258, in sampling_function out = calc_cond_batch(model, conds, x, timestep, model_options) File "K:\Programs\ComfyUI\custom_nodes\ComfyUI-TiledDiffusion.patches.py", line 4, in calc_cond_batch return calc_cond_batch_original_tiled_diffusion_9aa7f715(model, conds, x_in, timestep, model_options) File "K:\Programs\ComfyUI\comfy\samplers.py", line 216, in calc_cond_batch output = model_options['model_function_wrapper'](model.apply_model, {"input": inputx, "timestep": timestep, "c": c, "cond_or_uncond": cond_or_uncond}).chunk(batch_chunks) File "K:\Programs\ComfyUI\custom_nodes\ComfyUI_fabric\fabric\fabric.py", line 281, in unetwrapper = model_func(batch_latents, batch_ts, c_null_dict) File "K:\Programs\ComfyUI\comfy\model_base.py", line 97, in apply_model model_output = self.diffusion_model(xc, t, context=context, control=control, transformer_options=transformer_options, *extra_conds).float() File "K:\Programs\python\3.10.6\lib\site-packages\torch\nn\modules\module.py", line 1511, in _wrapped_call_impl return self._call_impl(args, kwargs) File "K:\Programs\python\3.10.6\lib\site-packages\torch\nn\modules\module.py", line 1520, in _call_impl return forward_call(*args, **kwargs) File "K:\Programs\ComfyUI\comfy\ldm\modules\diffusionmodules\openaimodel.py", line 844, in forward assert y.shape[0] == x.shape[0]

fabricXL

ssitu commented 6 months ago

I'm aware of the problem with XL and there is an existing issue for it. It has been giving that error since XL was released. I don't have the vram to run XL, so I haven't been able to debug it.

renwerx commented 6 months ago

All good, I feel you. I ate only noodles for three months to afford my 3060 and it's still only the bare minimum. This is going to be very useful even with only 1.5. Thanks again!

renwerx commented 6 months ago

How can I give you $25 towards a card?

ssitu commented 6 months ago

I appreciate the generosity, though a gpu isn't my priority at the moment so it wouldn't be fair to accept it.

renwerx commented 6 months ago

No strings implied lol I give you permission to spend it on whatever your priority is :). I also use USDU regularly so it's no skin off my nose to kick you a little something. If you just want to be an absolute champion and take the kudos in lieu other rewards then that's cool too and I salute you. Cheers!