Giter Site home page Giter Site logo

comfyui-ella's Introduction

ComfyUI-ELLA


ComfyUI implementation for ELLA.

🌟 Changelog

  • [2024.4.30] Add a new node ELLA Text Encode to automatically concat ella and clip condition.
  • [2024.4.24] Upgraded ELLA Apply method. Better compatibility with the comfyui ecosystem. Refer to the method mentioned in ComfyUI_ELLA PR #25
    • DEPRECATED: Apply ELLA without simgas is deprecated and it will be removed in a future version.
  • [2024.4.22] Fix unstable quality of image while multi-batch. Add CLIP concat (support lora trigger words now).
  • [2024.4.19] Documenting nodes.
  • [2024.4.19] Initial repo.

📌 Notice

  • SIGMAS from node BasicScheduler or TIMESTEPS by node Set ELLA Timesteps must be the same as the KSampler settings. Because Timestep-Aware Semantic Connector (TSC), which dynamically adapts semantics features over sampling time steps, has been introduced.
  • If you need concat clip CONDITIONING to make LoRA trigger words effective, ELLA output CONDITIONING always needs to be linked to the conditioning_to of Conditioning (Concat) node.

📚 Example workflows

The examples directory has workflow examples. You can directly load these images as workflow into ComfyUI for use.

workflow_example

All legacy workflows was compatible. But it is deprecated and will be removed in a future version.

workflow_example_legacy

🎉 It works with controlnet!

workflow_controlnet

🎉 It works with lora trigger words by concat CLIP CONDITIONING!

⚠️ NOTE again that ELLA CONDITIONING always needs to be linked to the conditioning_to of Conditioning (Concat) node.

workflow_lora

With ELLA Text Encode node, can simplify the workflow.

With the upgrade(2024.4.24), some interesting workflow can be implemented, such as using ELLA only in positive. As shown below:

workflow_lora_positive_ella_only

positive + negative positive only
ella_with_lora ella_with_lora_positive_only

However, there is no guarantee that positive-only will bring better results.

Workflow with AYS.

workflow_ella_ays

AYS got with more visual details and better text-alignment, ref to paper.

w/ AYS w/o AYS

And EMMA is working in progress.

📗 Install

Download or git clone this repository inside ComfyUI/custom_nodes/ directory. ComfyUI-ELLA requires the latest version of ComfyUI. If something doesn't work be sure to upgrade.

cd ComfyUI/custom_nodes
git clone https://github.com/TencentQQGYLab/ComfyUI-ELLA

Next install dependencies.

cd ComfyUI-ELLA
pip install -r requirements.txt

📙 Models

These models must be placed in the corresponding directories under models.

Remember you can also use any custom location setting an ella & ella_encoder entry in the extra_model_paths.yaml file.

  • ComfyUI/models/ella, create it if not present.
  • ComfyUI/models/ella_encoder, create it if not present.

In summary, you should have the following model directory structure:

ComfyUI/models/ella/
└── ella-sd1.5-tsc-t5xl.safetensors

ComfyUI/models/ella_encoder/
└── models--google--flan-t5-xl--text_encoder
    ├── config.json
    ├── model.safetensors
    ├── special_tokens_map.json
    ├── spiece.model
    ├── tokenizer_config.json
    └── tokenizer.json

📖 Nodes reference

Nodes reference

🔍 Common promblem

  • XXX not implemented for 'Half'. See issue #12
  • AYS + Ella getting dark image generations. See issue #39
    • Check if add_noise of SamplerCustom node is enabled.
    • Lower the cfg of SamplerCustom node.

📝 TODO

  • Support prompt weighting

🤗 Contributors (direct & indirect)


JettHu

budui

kijai

huagetai

😋 Thanks

😉 Citation

@misc{hu2024ella,
      title={ELLA: Equip Diffusion Models with LLM for Enhanced Semantic Alignment}, 
      author={Xiwei Hu and Rui Wang and Yixiao Fang and Bin Fu and Pei Cheng and Gang Yu},
      year={2024},
      eprint={2403.05135},
      archivePrefix={arXiv},
      primaryClass={cs.CV}
}

comfyui-ella's People

Contributors

budui avatar huagetai avatar jetthu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

comfyui-ella's Issues

Worse image quality when combine with ipadapter

non-Ella workflow result combined with ipadapter:
image
Ella workflow result combined with ipadapter:
image
ipadapter reference style image:
china_texture JPEG
the Ella workflow image result is far less realistic than non-Ella workflow when the reference style image mostly contains unrealistic textures. I guess this is somewhat because the ipadapter's overfiting, the image prompt is too strong that it overpass the text prompt, but the non-Ella workflow result is realistic enough, they use the same ipadapter and the same hyperparameters, so I wonder if it's beacause Ella's output condition embedding does not matches with the origin SD's Unet as well as CLIPTextEncoder's output condition embeding. I wonder if there's simple trick to tackle this problem? free-training solution is better~
@JettHu

rror occurred when executing T5TextEncoderLoader #ELLA: Error(s) in loading state_dict for T5EncoderModel: size mismatch for shared.weight: copying a param with shape torch.Size([32128, 2048]) from checkpoint, the shape in current model is torch.Size([32128, 512]). size mismatch for encoder.block.0.layer.0.SelfAttention.q.weight: copying a param with shape torch.Size([2048, 2048]) from checkpoint, the shape in current model is torch.Size([512, 512]).

rror occurred when executing T5TextEncoderLoader #ELLA:

Error(s) in loading state_dict for T5EncoderModel:
size mismatch for shared.weight: copying a param with shape torch.Size([32128, 2048]) from checkpoint, the shape in current model is torch.Size([32128, 512]).
size mismatch for encoder.block.0.layer.0.SelfAttention.q.weight: copying a param with shape torch.Size([2048, 2048]) from checkpoint, the shape in current model is torch.Size([512, 512]).

文件路径错误

image
这都什么玩意啊,下载的东西里面也没有这些啊,真tmd服了
image

load ella model

Error occurred when executing ELLALoader:

Error(s) in loading state_dict for ELLAModel:
Missing key(s) in state_dict: "connector.latents", "connector.perceiver_blocks.0.attn.in_proj_bias", "connector.perceiver_blocks.0.attn.in_proj_weight", "connector.perceiver_blocks.0.attn.out_proj.bias", "connector.perceiver_blocks.0.attn.out_proj.weight", "connector.perceiver_blocks.0.ln_1.linear.bias", "connector.perceiver_blocks.0.ln_1.linear.weight", "connector.perceiver_blocks.0.ln_2.linear.bias", "connector.perceiver_blocks.0.ln_2.linear.weight", "connector.perceiver_blocks.0.ln_ff.linear.bias", "connector.perceiver_blocks.0.ln_ff.linear.weight", "connector.perceiver_blocks.0.mlp.c_fc.bias", "connector.perceiver_blocks.0.mlp.c_fc.weight", "connector.perceiver_blocks.0.mlp.c_proj.bias", "connector.perceiver_blocks.0.mlp.c_proj.weight", "connector.perceiver_blocks.1.attn.in_proj_bias", "connector.perceiver_blocks.1.attn.in_proj_weight", "connector.perceiver_blocks.1.attn.out_proj.bias", "connector.perceiver_blocks.1.attn.out_proj.weight", "connector.perceiver_blocks.1.ln_1.linear.bias", "connector.perceiver_blocks.1.ln_1.linear.weight", "connector.perceiver_blocks.1.ln_2.linear.bias", "connector.perceiver_blocks.1.ln_2.linear.weight", "connector.perceiver_blocks.1.ln_ff.linear.bias", "connector.perceiver_blocks.1.ln_ff.linear.weight", "connector.perceiver_blocks.1.mlp.c_fc.bias", "connector.perceiver_blocks.1.mlp.c_fc.weight", "connector.perceiver_blocks.1.mlp.c_proj.bias", "connector.perceiver_blocks.1.mlp.c_proj.weight", "connector.perceiver_blocks.2.attn.in_proj_bias", "connector.perceiver_blocks.2.attn.in_proj_weight", "connector.perceiver_blocks.2.attn.out_proj.bias", "connector.perceiver_blocks.2.attn.out_proj.weight", "connector.perceiver_blocks.2.ln_1.linear.bias", "connector.perceiver_blocks.2.ln_1.linear.weight", "connector.perceiver_blocks.2.ln_2.linear.bias", "connector.perceiver_blocks.2.ln_2.linear.weight", "connector.perceiver_blocks.2.ln_ff.linear.bi
waht is that problem?

节点失败了

When loading the graph, the following node types were not found:
ELLALoader
T5TextEncoderLoader #ELLA
加载失败的节点会显示为红色

M1 max, Error occurred when executing EllaApply: "LayerNormKernelImpl" not implemented for 'Half'

Error occurred when executing EllaApply:

"LayerNormKernelImpl" not implemented for 'Half'

File "/Users/weiwei/ComfyUI/execution.py", line 151, in recursive_execute
output_data, output_ui = get_output_data(obj, input_data_all)
File "/Users/weiwei/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 "/Users/weiwei/ComfyUI/execution.py", line 74, in map_node_over_list
results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
File "/Users/weiwei/ComfyUI/custom_nodes/ComfyUI-ELLA/ella.py", line 161, in apply
conds = ella_encode(ella["model"], timesteps, positive)
File "/Users/weiwei/ComfyUI/custom_nodes/ComfyUI-ELLA/ella.py", line 42, in ella_encode
cond_ella = ella(timestep, **embeds)
File "/Users/weiwei/ComfyUI/custom_nodes/ComfyUI-ELLA/model.py", line 330, in call
cond = self.model(timesteps, t5_embeds, **kwargs)
File "/Users/weiwei/Envs/comfyui/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1511, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "/Users/weiwei/Envs/comfyui/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1520, in _call_impl
return forward_call(*args, **kwargs)
File "/Users/weiwei/ComfyUI/custom_nodes/ComfyUI-ELLA/model.py", line 308, in forward
return self.connector(t5_embeds, timestep_embedding=time_embedding)
File "/Users/weiwei/Envs/comfyui/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1511, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "/Users/weiwei/Envs/comfyui/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1520, in _call_impl
return forward_call(*args, **kwargs)
File "/Users/weiwei/ComfyUI/custom_nodes/ComfyUI-ELLA/model.py", line 110, in forward
latents = p_block(x, latents, timestep_embedding=timestep_embedding)
File "/Users/weiwei/Envs/comfyui/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1511, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "/Users/weiwei/Envs/comfyui/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1520, in _call_impl
return forward_call(*args, **kwargs)
File "/Users/weiwei/ComfyUI/custom_nodes/ComfyUI-ELLA/model.py", line 69, in forward
normed_latents = self.ln_1(latents, timestep_embedding)
File "/Users/weiwei/Envs/comfyui/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1511, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "/Users/weiwei/Envs/comfyui/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1520, in _call_impl
return forward_call(*args, **kwargs)
File "/Users/weiwei/ComfyUI/custom_nodes/ComfyUI-ELLA/model.py", line 32, in forward
return self.norm(x) * (1 + scale) + shift
File "/Users/weiwei/Envs/comfyui/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1511, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "/Users/weiwei/Envs/comfyui/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1520, in _call_impl
return forward_call(*args, **kwargs)
File "/Users/weiwei/Envs/comfyui/lib/python3.10/site-packages/torch/nn/modules/normalization.py", line 201, in forward
return F.layer_norm(
File "/Users/weiwei/ComfyUI/custom_nodes/ComfyUI_smZNodes/modules/sd_hijack_utils.py", line 17, in
setattr(resolved_obj, func_path[-1], lambda *args, **kwargs: self(*args, **kwargs))
File "/Users/weiwei/ComfyUI/custom_nodes/ComfyUI_smZNodes/modules/sd_hijack_utils.py", line 28, in call
return self.__orig_func(*args, **kwargs)
File "/Users/weiwei/Envs/comfyui/lib/python3.10/site-packages/torch/nn/functional.py", line 2546, in layer_norm
return torch.layer_norm(input, normalized_shape, weight, bias, eps, torch.backends.cudnn.enabled)

'ModelPatcher' object has no attribute 'get_model_object'

Meeting an error when executing the basic example.

Error occurred when executing EllaApply:

'ModelPatcher' object has no attribute 'get_model_object'

File "/home/ubuntu/ComfyUI/execution.py", line 152, in recursive_execute
output_data, output_ui = get_output_data(obj, input_data_all)
File "/home/ubuntu/ComfyUI/execution.py", line 82, in get_output_data
return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
File "/home/ubuntu/ComfyUI/execution.py", line 75, in map_node_over_list
results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
File "/home/ubuntu/ComfyUI/custom_nodes/ComfyUI-ELLA/ella.py", line 161, in apply
model_sampling = model_clone.get_model_object("model_sampling")

Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cpu!

在ella text Encode提示出错

Error occurred when executing EllaTextEncode:

Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cpu!

File "D:\comfyui\execution.py", line 151, in recursive_execute
output_data, output_ui = get_output_data(obj, input_data_all)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\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 "D:\comfyui\execution.py", line 74, in map_node_over_list
results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\comfyui\custom_nodes\ComfyUI-ELLA\ella.py", line 289, in encode
ella_conds = ella_encode(ella["model"], timesteps, embeds)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\comfyui\custom_nodes\ComfyUI-ELLA\ella.py", line 42, in ella_encode
cond_ella = ella(timestep, **embeds)
^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\comfyui\custom_nodes\ComfyUI-ELLA\model.py", line 330, in call
cond = self.model(timesteps, t5_embeds, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\comfyui.ext\Lib\site-packages\torch\nn\modules\module.py", line 1511, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\comfyui.ext\Lib\site-packages\torch\nn\modules\module.py", line 1520, in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\comfyui\custom_nodes\ComfyUI-ELLA\model.py", line 308, in forward
return self.connector(t5_embeds, timestep_embedding=time_embedding)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\comfyui.ext\Lib\site-packages\torch\nn\modules\module.py", line 1511, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\comfyui.ext\Lib\site-packages\torch\nn\modules\module.py", line 1520, in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\comfyui\custom_nodes\ComfyUI-ELLA\model.py", line 106, in forward
latents = learnable_latents + self.time_aware_linear(torch.nn.functional.silu(timestep_embedding))

我的显存不大3080 10G,windows 11环境,是采用了共享显存的模式在运行comfyUI。

Error in sampling stage- possibly related to MPS backend

Getting this error:

File "/Users/jackwooldridge/ComfyUI/execution.py", line 151, in recursive_execute
    output_data, output_ui = get_output_data(obj, input_data_all)
  File "/Users/jackwooldridge/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 "/Users/jackwooldridge/ComfyUI/execution.py", line 74, in map_node_over_list
    results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
  File "/Users/jackwooldridge/ComfyUI/nodes.py", line 1344, in sample
    return common_ksampler(model, seed, steps, cfg, sampler_name, scheduler, positive, negative, latent_image, denoise=denoise)
  File "/Users/jackwooldridge/ComfyUI/nodes.py", line 1314, in common_ksampler
    samples = comfy.sample.sample(model, noise, steps, cfg, sampler_name, scheduler, positive, negative, latent_image,
  File "/Users/jackwooldridge/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 "/Users/jackwooldridge/ComfyUI/comfy/samplers.py", line 755, 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 "/Users/jackwooldridge/ComfyUI/comfy/samplers.py", line 657, in sample
    return cfg_guider.sample(noise, latent_image, sampler, sigmas, denoise_mask, callback, disable_pbar, seed)
  File "/Users/jackwooldridge/ComfyUI/comfy/samplers.py", line 644, in sample
    output = self.inner_sample(noise, latent_image, device, sampler, sigmas, denoise_mask, callback, disable_pbar, seed)
  File "/Users/jackwooldridge/ComfyUI/comfy/samplers.py", line 623, in inner_sample
    samples = sampler.sample(self, sigmas, extra_args, callback, noise, latent_image, denoise_mask, disable_pbar)
  File "/Users/jackwooldridge/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 "/Users/jackwooldridge/ComfyUI/venv/lib/python3.9/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
    return func(*args, **kwargs)
  File "/Users/jackwooldridge/ComfyUI/comfy/k_diffusion/sampling.py", line 137, in sample_euler
    denoised = model(x, sigma_hat * s_in, **extra_args)
  File "/Users/jackwooldridge/ComfyUI/comfy/samplers.py", line 272, in __call__
    out = self.inner_model(x, sigma, model_options=model_options, seed=seed)
  File "/Users/jackwooldridge/ComfyUI/comfy/samplers.py", line 610, in __call__
    return self.predict_noise(*args, **kwargs)
  File "/Users/jackwooldridge/ComfyUI/comfy/samplers.py", line 613, 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 "/Users/jackwooldridge/ComfyUI/comfy/samplers.py", line 258, in sampling_function
    out = calc_cond_batch(model, conds, x, timestep, model_options)
  File "/Users/jackwooldridge/ComfyUI/comfy/samplers.py", line 216, in calc_cond_batch
    output = model_options['model_function_wrapper'](model.apply_model, {"input": input_x, "timestep": timestep_, "c": c, "cond_or_uncond": cond_or_uncond}).chunk(batch_chunks)
  File "/Users/jackwooldridge/ComfyUI/custom_nodes/ComfyUI-ELLA/ella.py", line 67, in __call__
    self.model_sampling.timestep(timestep_[i]),
IndexError: index 1 is out of bounds for dimension 0 with size 1

Seems to be related to this function:

def __call__(self, apply_model, kwargs: dict):
        input_x = kwargs["input"]
        timestep_ = kwargs["timestep"]
        c = kwargs["c"]
        cond_or_uncond = kwargs["cond_or_uncond"]  # [0|1]

        time_aware_encoder_hidden_states = []
        self.ella.to(device=self.load_device)
        for i in cond_or_uncond:
            h = self.ella(
                self.model_sampling.timestep(timestep_[i]),
                **self.embeds[i],
            )
            time_aware_encoder_hidden_states.append(h)
        self.ella.to(self.offload_device)

        c["c_crossattn"] = torch.cat(time_aware_encoder_hidden_states, dim=0)

        return apply_model(input_x, timestep_, **c)

This happens while running the latest ComfyUI on MacOS with "python main.py --preview-method taesd" as the initialization command. Also fails when running in force-fp16 mode. Fails if the encoder is set to fp32 or fp16. Let me know if I can provide any other information. Thanks!

A1111 type prompt features?

Do these work?

Such as the "weighted text"
person changed to [person:1.1]

And the toggle between
[cat|dog] or [blue | red | gold]

or the prompt steps:
[x::number] Ignores x after number steps have finished.
[x:x:number] Uses the first x until number steps have finished, then uses the second x.

AYS + ELLA

I tested and found that adding AYS significantly boost the prompt adherence, I tried to output Ella conditioninng to custom sampler with AYS and have some good results too however it false to generate image higher than 1024x1024.
Maybe you can make it compatible natively.

https://arxiv.org/abs/2404.14507

Load T5 Text Encoder dropdown is empty

I followed the instructions in the readme file and put all files in the correct location:
Screenshot 2024-04-21 at 15 36 46

However, when I open the example workflow I get this:
Screenshot 2024-04-21 at 15 37 27

Looks like it can't find the necessary file. What am I doing wrong?

Error occurred when executing T5TextEncode #ELLA: (RX580 i39100f Windows11 32gb Ram)

Error occurred when executing T5TextEncode #ELLA:

"addmm_impl_cpu_" not implemented for 'Half'

File "C:\Users\WarMa\OneDrive\Escritorio\ComfyUI\ComfyUI\execution.py", line 151, in recursive_execute
output_data, output_ui = get_output_data(obj, input_data_all)
File "C:\Users\WarMa\OneDrive\Escritorio\ComfyUI\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 "C:\Users\WarMa\OneDrive\Escritorio\ComfyUI\ComfyUI\execution.py", line 74, in map_node_over_list
results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
File "C:\Users\WarMa\OneDrive\Escritorio\ComfyUI\ComfyUI\custom_nodes\ComfyUI-ELLA\ella.py", line 228, in encode
cond = text_encoder_model(text, max_length=max_length)
File "C:\Users\WarMa\OneDrive\Escritorio\ComfyUI\ComfyUI\custom_nodes\ComfyUI-ELLA\model.py", line 158, in call
outputs = self.model(text_input_ids, attention_mask=attention_mask) # type: ignore
File "C:\Users\WarMa\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "C:\Users\WarMa\AppData\Local\Programs\Python\Python310\lib\site-packages\transformers\models\t5\modeling_t5.py", line 1980, in forward
encoder_outputs = self.encoder(
File "C:\Users\WarMa\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "C:\Users\WarMa\AppData\Local\Programs\Python\Python310\lib\site-packages\transformers\models\t5\modeling_t5.py", line 1115, in forward
layer_outputs = layer_module(
File "C:\Users\WarMa\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "C:\Users\WarMa\AppData\Local\Programs\Python\Python310\lib\site-packages\transformers\models\t5\modeling_t5.py", line 695, in forward
self_attention_outputs = self.layer[0](
File "C:\Users\WarMa\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "C:\Users\WarMa\AppData\Local\Programs\Python\Python310\lib\site-packages\transformers\models\t5\modeling_t5.py", line 602, in forward
attention_output = self.SelfAttention(
File "C:\Users\WarMa\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "C:\Users\WarMa\AppData\Local\Programs\Python\Python310\lib\site-packages\transformers\models\t5\modeling_t5.py", line 521, in forward
query_states = shape(self.q(hidden_states)) # (batch_size, n_heads, seq_length, dim_per_head)
File "C:\Users\WarMa\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "C:\Users\WarMa\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\linear.py", line 114, in forward
return F.linear(input, self.weight, self.bias)

Load T5 TextEncoder ELLA - Required input is missing: name

Downloaded JSON files have this prefix:
models--google--flan-t5-xl--text_encoder_... json

example pic has this:
image

model structure in installation info README.MD has this, which suggests we trim the prefix down:
image

I have them installed here, as this:
image

And I get this message from ComfyUI:
_Failed to validate prompt for output 12:

  • T5TextEncoderLoader #ELLA 13:
    • Required input is missing: name
  • T5TextEncode #ELLA 7:
    • Required input is missing: text_encoder
      Output will be ignored
      invalid prompt: {'type': 'prompt_outputs_failed_validation', 'message': 'Prompt outputs failed validation', 'details': '', 'extra_info': {}}
      got prompt
      Failed to validate prompt for output 12:
  • T5TextEncoderLoader #ELLA 13:
    • Required input is missing: name
      Output will be ignored
      invalid prompt: {'type': 'prompt_outputs_failed_validation', 'message': 'Prompt outputs failed validation', 'details': '', 'extra_info': {}}_

When I change the file names to remove the prefixes to be this:
image

close my browser & restart ComfyUI
I get this:
image
And when I click the arrow to select it becomes this:
image

And this when I try to run:
Failed to validate prompt for output 12:
_* T5TextEncoderLoader #ELLA 13:

  • Required input is missing: name
    Output will be ignored
    invalid prompt: {'type': 'prompt_outputs_failed_validation', 'message': 'Prompt outputs failed validation', 'details': '', 'extra_info': {}}_

One node reported an error

[ERROR] An error occurred while retrieving information for the 'T5TextEncoderLoader #ELLA' node.
Traceback (most recent call last):
File "H:\ai\comfyui\comfyui2\new_ComfyUI_windows_portable_nvidia_cu121_or_cpu\ComfyUI_windows_portable\ComfyUI\server.py", line 414, in get_object_info
out[x] = node_info(x)
^^^^^^^^^^^^
File "H:\ai\comfyui\comfyui2\new_ComfyUI_windows_portable_nvidia_cu121_or_cpu\ComfyUI_windows_portable\ComfyUI\server.py", line 392, in node_info
info['input'] = obj_class.INPUT_TYPES()
^^^^^^^^^^^^^^^^^^^^^^^
File "H:\ai\comfyui\comfyui2\new_ComfyUI_windows_portable_nvidia_cu121_or_cpu\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-ELLA\ella.py", line 176, in INPUT_TYPES
for search_path in folder_paths.get_folder_paths("ella_encoder"):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "H:\ai\comfyui\comfyui2\new_ComfyUI_windows_portable_nvidia_cu121_or_cpu\ComfyUI_windows_portable\ComfyUI\folder_paths.py", line 134, in get_folder_paths
return folder_names_and_paths[folder_name][0][:]
~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
KeyError: 'ella_encoder'

Apply ELLA node error,TypeError: cannot create weak reference to 'NoneType' object

!!! Exception during processing!!! cannot create weak reference to 'NoneType' object
Traceback (most recent call last):
File "E:\IMAGE\ComfyUI-base-py311\ComfyUI\execution.py", line 151, in recursive_execute
output_data, output_ui = get_output_data(obj, input_data_all)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "E:\IMAGE\ComfyUI-base-py311\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 "E:\IMAGE\ComfyUI-base-py311\ComfyUI\execution.py", line 74, in map_node_over_list
results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "E:\IMAGE\ComfyUI-base-py311\ComfyUI\custom_nodes\ComfyUI-ELLA\ella.py", line 155, in apply
model_clone = model.clone()
^^^^^^^^^^^^^
File "E:\IMAGE\ComfyUI-base-py311\ComfyUI\comfy\model_patcher.py", line 79, in clone
n.model_options = copy.deepcopy(self.model_options)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "copy.py", line 146, in deepcopy
File "copy.py", line 231, in _deepcopy_dict
File "copy.py", line 146, in deepcopy
File "copy.py", line 231, in _deepcopy_dict
File "copy.py", line 146, in deepcopy
File "copy.py", line 231, in _deepcopy_dict
File "copy.py", line 172, in deepcopy
File "copy.py", line 271, in _reconstruct
File "copy.py", line 146, in deepcopy
File "copy.py", line 231, in _deepcopy_dict
File "copy.py", line 172, in deepcopy
File "copy.py", line 297, in _reconstruct
File "copy.py", line 172, in deepcopy
File "copy.py", line 271, in _reconstruct
File "copy.py", line 146, in deepcopy
File "copy.py", line 231, in _deepcopy_dict
File "copy.py", line 172, in deepcopy
File "copy.py", line 297, in _reconstruct
File "copy.py", line 172, in deepcopy
File "copy.py", line 271, in _reconstruct
File "copy.py", line 146, in deepcopy
File "copy.py", line 231, in _deepcopy_dict
File "copy.py", line 146, in deepcopy
File "copy.py", line 231, in _deepcopy_dict
File "copy.py", line 146, in deepcopy
File "copy.py", line 206, in _deepcopy_list
File "copy.py", line 172, in deepcopy
File "copy.py", line 273, in _reconstruct
File "E:\IMAGE\ComfyUI-base-py311\python_embeded\Lib\site-packages\torch\utils\hooks.py", line 62, in setstate
self.extra_dict_ref = tuple(weakref.ref(d) for d in state[2])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "E:\IMAGE\ComfyUI-base-py311\python_embeded\Lib\site-packages\torch\utils\hooks.py", line 62, in
self.extra_dict_ref = tuple(weakref.ref(d) for d in state[2])
^^^^^^^^^^^^^^
TypeError: cannot create weak reference to 'NoneType' object

Fixed: An error occurred while retrieving information for the 'ELLALoader' node.

I updated ComfyUI and all extensions before proceeding with this install. I ran the update through manager and also did a git pull.

I tried installing this through manager in ComfyUI, I tried to 'Update' through manager, and, I also tried using git clone after doing an 'uninstall' through manager and deleting the directory, all result in this not installing correctly and ella erroring out on load.
I installed the requirements through ComfyUI's python.
I downloaded everything as shown in the instructions. The file names and directory structure are the same as shown in your install instructions.

This is what I receive when I open ComfyUI:

[ERROR] An error occurred while retrieving information for the 'ELLALoader' node.
Traceback (most recent call last):
File "D:\Ai\ComfyUI\ComfyUI_windows_portable\ComfyUI\server.py", line 414, in get_object_info
out[x] = node_info(x)
^^^^^^^^^^^^
File "D:\Ai\ComfyUI\ComfyUI_windows_portable\ComfyUI\server.py", line 392, in node_info
info['input'] = obj_class.INPUT_TYPES()
^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Ai\ComfyUI\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-ELLA\ella.py", line 156, in INPUT_TYPES
"name": (folder_paths.get_filename_list("ella"),),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Ai\ComfyUI\ComfyUI_windows_portable\ComfyUI\folder_paths.py", line 225, in get_filename_list
out = get_filename_list_(folder_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Ai\ComfyUI\ComfyUI_windows_portable\ComfyUI\folder_paths.py", line 192, in get_filename_list_
folders = folder_names_and_paths[folder_name]
~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
KeyError: 'ella'

[ERROR] An error occurred while retrieving information for the 'T5TextEncoderLoader #ELLA' node.
Traceback (most recent call last):
File "D:\Ai\ComfyUI\ComfyUI_windows_portable\ComfyUI\server.py", line 414, in get_object_info
out[x] = node_info(x)
^^^^^^^^^^^^
File "D:\Ai\ComfyUI\ComfyUI_windows_portable\ComfyUI\server.py", line 392, in node_info
info['input'] = obj_class.INPUT_TYPES()
^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Ai\ComfyUI\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-ELLA\ella.py", line 176, in INPUT_TYPES
for search_path in folder_paths.get_folder_paths("ella_encoder"):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Ai\ComfyUI\ComfyUI_windows_portable\ComfyUI\folder_paths.py", line 134, in get_folder_paths
return folder_names_and_paths[folder_name][0][:]
~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
KeyError: 'ella_encoder'

Question: Using Embeddings in T5 Text Encode Node

Hello,

Thank you for the great work on this project!

I have a question regarding the usage of embeddings in the T5 Text Encode node. Is it appropriate to use embeddings in this context, given that they are originally used under the CLIP Text Encode node?

Thank you for your assistance!

Extremely slow generation

Hi, my gpu is gtx 1660 (6 gb) and while using ella my speed drop from 1.5it/s to 5s/it, seems like cuda cores are almost not being used and my CPU does most of the calculations instead

low cuda usage
cpu usage

T5TextEncoderLoader显示报错

微信图片_20240429103738
微信图片_20240429103742

我想请教下运行T5TextEncoderLoader显示报错:执行T5TextEncoderLoader时出错#ELLA:

'added_tokens'
File "E:\comfyUI\ComfyUI\execution.py", line 151, in recursive_execute
output_data, output_ui = get_output_data(obj, input_data_all)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "E:\comfyUI\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 "E:\comfyUI\ComfyUI\execution.py", line 74, in map_node_over_list
results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "E:\comfyUI\ComfyUI\custom_nodes\ComfyUI-ELLA\ella.py", line 323, in load
t5_encoder = T5TextEmbedder(t5_file, max_length=max_length or None, dtype=dtype) # type: ignore
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "E:\comfyUI\ComfyUI\custom_nodes\ComfyUI-ELLA\model.py", line 127, in init
self.tokenizer = T5Tokenizer.from_pretrained(pretrained_path, legacy=legacy)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "E:\comfyUI\ComfyUI\venv\Lib\site-packages\transformers\tokenization_utils_base.py", line 2089, in from_pretrained
return cls._from_pretrained(
^^^^^^^^^^^^^^^^^^^^^
File "E:\comfyUI\ComfyUI\venv\Lib\site-packages\transformers\tokenization_utils_base.py", line 2293, in _from_pretrained
added_tokens = tokenizer_file_handle.pop("added_tokens")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

通过访问gpt这个问题得到的是没有从分词器文件句柄访问快捷键,但是想要缺少该键,从而导致错误,想问一下这个错误怎么解决呢

用了ComfyUI-ELLA反而更加不听说了,而且质量更差

用了ComfyUI-ELLA反而更加不听说了,出图的质量更差,请问是什么问题?
同一个模型,同一套提示词,

这是没用ComfyUI-ELLA的
ComfyUI_01063_
这是用了ComfyUI-ELLA的
ComfyUI_01064_

我明明用了1girl和solo的提示词,ELLA每次给生成多个女孩,

AYS + ELLA + AnimateDiff anyone?

Been hooking it up, trying to use IP Adapters & CN to get it to behave. Has anyone had difficulty with it churning out super-noisy or mangled vids?

Or anyone had this work for them in?

Output image quality is unstable

Hi, thank you for developing the comfyui-ELLA. I got it for the first time and compared it with the SD15 general process. I don’t know if it is a problem with my settings. I tested a lot of prompts and found that the Ella img rendering effect is very unstable and not good. And No matter how you adjust it, it is difficult to improve the img quality. Do you have better preset parameters?

workflow is here
workflow

fp8 is not supported

The image generated in f8 mode will report an error
Error occurred when executing T5TextEncode #ELLA:

"index_select_cuda" not implemented for 'Float8_e5m2'

NSFW even with negative

Hi,

I have tried the workflow with ELLA and I got nudes and worse - kids nudes - even with negative NSFW, naked, nude

Please make sure to have safe generation with negative active.

wf-ella-issue.json

你好,RuntimeError: mat1 and mat2 shapes cannot be multiplied (89x1024 and 2048x768)

Error occurred when executing EllaApply:

mat1 and mat2 shapes cannot be multiplied (89x1024 and 2048x768)

File "D:\ruanjian\ComfyUI\ComfyUI\execution.py", line 151, in recursive_execute
output_data, output_ui = get_output_data(obj, input_data_all)
File "D:\ruanjian\ComfyUI\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 "D:\ruanjian\ComfyUI\ComfyUI\execution.py", line 74, in map_node_over_list
results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
File "D:\ruanjian\ComfyUI\ComfyUI\custom_nodes\ComfyUI-ELLA-main\ella.py", line 164, in apply
conds, unconds = self.legacy_patch(ella["model"], positive, negative, mode, model_clone, model_sampling)
File "D:\ruanjian\ComfyUI\ComfyUI\custom_nodes\ComfyUI-ELLA-main\ella.py", line 179, in legacy_patch
_cond, _uncond = ella_proxy.prepare_conds()
File "D:\ruanjian\ComfyUI\ComfyUI\custom_nodes\ComfyUI-ELLA-main\ella.py", line 76, in prepare_conds
cond = self.ella(torch.Tensor([999]), **cond_embeds)
File "D:\ruanjian\ComfyUI\ComfyUI\custom_nodes\ComfyUI-ELLA-main\model.py", line 330, in call
cond = self.model(timesteps, t5_embeds, **kwargs)
File "D:\ruanjian\ComfyUI\python_embeded\lib\site-packages\torch\nn\modules\module.py", line 1532, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "D:\ruanjian\ComfyUI\python_embeded\lib\site-packages\torch\nn\modules\module.py", line 1541, in _call_impl
return forward_call(*args, **kwargs)
File "D:\ruanjian\ComfyUI\ComfyUI\custom_nodes\ComfyUI-ELLA-main\model.py", line 308, in forward
return self.connector(t5_embeds, timestep_embedding=time_embedding)
File "D:\ruanjian\ComfyUI\python_embeded\lib\site-packages\torch\nn\modules\module.py", line 1532, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "D:\ruanjian\ComfyUI\python_embeded\lib\site-packages\torch\nn\modules\module.py", line 1541, in _call_impl
return forward_call(*args, **kwargs)
File "D:\ruanjian\ComfyUI\ComfyUI\custom_nodes\ComfyUI-ELLA-main\model.py", line 108, in forward
x = self.proj_in(x)
File "D:\ruanjian\ComfyUI\python_embeded\lib\site-packages\torch\nn\modules\module.py", line 1532, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "D:\ruanjian\ComfyUI\python_embeded\lib\site-packages\torch\nn\modules\module.py", line 1541, in _call_impl
return forward_call(*args, **kwargs)
File "D:\ruanjian\ComfyUI\python_embeded\lib\site-packages\torch\nn\modules\linear.py", line 116, in forward
return F.linear(input, self.weight, self.bias)

这是报错的页面,麻烦您帮忙解答一下,谢谢了

Please add drivable external input to prompt nodes.

Would it be possible to add the possibility of using an external node as input text?
I am referring in particular to the opportunity to use automated prompt generators such as One Button Prompt.
Thanks!

Concat conditionings

I get this error when trying to concat ELLA and CLIP conditionings together. I'm trying to do this to inject trigger words and/or embeddings. In ExponentialML's implementation this works though. Is there a way to work around this?


Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cpu! (when checking argument for argument tensors in method wrapper_CUDA_cat)

File "E:\AI\ComfyUI\ComfyUI\execution.py", line 151, in recursive_execute
output_data, output_ui = get_output_data(obj, input_data_all)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "E:\AI\ComfyUI\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 "E:\AI\ComfyUI\ComfyUI\execution.py", line 74, in map_node_over_list
results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "E:\AI\ComfyUI\ComfyUI\nodes.py", line 133, in concat
tw = torch.cat((t1, cond_from),1)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^```

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.