0% 0/28 [00:07<?, ?it/s] Traceback (most recent call last): File…
- User
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
0%| | 0/28 [00:07<?, ?it/s] Traceback (most recent call last): File "/path/lib/python3.11/site-packages/gradio/queueing.py", line 407, in call_prediction output = await route_utils.call_process_api( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/path/lib/python3.11/site-packages/gradio/route_utils.py", line 226, in call_process_api output = await app.get_blocks().process_api( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/path/lib/python3.11/site-packages/gradio/blocks.py", line 1550, in process_api result = await self.call_function( ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/path/lib/python3.11/site-packages/gradio/blocks.py", line 1185, in call_function prediction = await anyio.to_thread.run_sync( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/path/lib/python3.11/site-packages/anyio/to_thread.py", line 56, in run_sync return await get_async_backend().run_sync_in_worker_thread( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/path/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 2470, in run_sync_in_worker_thread return await future ^^^^^^^^^^^^ File "/path/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 967, in run result = context.run(func, *args) ^^^^^^^^^^^^^^^^^^^^^^^^ File "/path/lib/python3.11/site-packages/gradio/utils.py", line 661, in wrapper response = f(*args, **kwargs) ^^^^^^^^^^^^^^^^^^ File "/home/uwuntu/code/projects/rm_obj_video/Omnieraser/ControlNet_version/gradio_controlnet_lora_flux.py", line 158, in infer return predict(input_image, ^^^^^^^^^^^^^^^^^^^^ File "/home/uwuntu/code/projects/rm_obj_video/Omnieraser/ControlNet_version/gradio_controlnet_lora_flux.py", line 112, in predict result = pipe( ^^^^^ File "/path/lib/python3.11/site-packages/torch/utils/_contextlib.py", line 116, in decorate_context return func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "/home/uwuntu/code/projects/rm_obj_video/Omnieraser/ControlNet_version/pipeline_flux_controlnet_removal.py", line 958, in call ) = self.controlnet( ^^^^^^^^^^^^^^^^ File "/path/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1739, in _wrapped_call_impl return self._call_impl(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/path/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1750, in _call_impl return forward_call(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/path/lib/python3.11/site-packages/accelerate/hooks.py", line 170, in new_forward output = module._old_forward(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/uwuntu/code/projects/rm_obj_video/Omnieraser/ControlNet_version/controlnet_flux.py", line 332, in forward encoder_hidden_states, hidden_states = block( ^^^^^^ File "/path/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1739, in _wrapped_call_impl return self._call_impl(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/path/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1750, in _call_impl return forward_call(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/uwuntu/code/projects/rm_obj_video/Omnieraser/ControlNet_version/transformer_flux.py", line 213, in forward attn_output, context_attn_output = self.attn( ^^^^^^^^^^ File "/path/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1739, in _wrapped_call_impl return self._call_impl(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/path/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1750, in _call_impl return forward_call(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/path/src/diffusers/src/diffusers/models/attention_processor.py", line 605, in forward return self.processor( ^^^^^^^^^^^^^^^ File "/path/src/diffusers/src/diffusers/models/attention_processor.py", line 2339, in call query = apply_rotary_emb(query, image_rotary_emb) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/path/src/diffusers/src/diffusers/models/embeddings.py", line 1197, in apply_rotary_emb cos, sin = freqs_cis # [S, D] ^^^^^^^^ ValueError: not enough values to unpack (expected 2, got 1)
File "/home/uwuntu/code/projects/rm_obj_video/Omnieraser/ControlNet_version/gradio_controlnet_lora_flux.py", line 112, in predict result = pipe( ^^^^^ File "/path/lib/python3.11/site-packages/torch/utils/_contextlib.py", line 116, in decorate_context return func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "/home/uwuntu/code/projects/rm_obj_video/Omnieraser/ControlNet_version/pipeline_flux_controlnet_removal.py", line 958, in call ) = self.controlnet( ^^^^^^^^^^^^^^^^ File "/path/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1739, in _wrapped_call_impl return self._call_impl(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/path/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1750, in _call_impl return forward_call(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/path/lib/python3.11/site-packages/accelerate/hooks.py", line 170, in new_forward output = module._old_forward(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/uwuntu/code/projects/rm_obj_video/Omnieraser/ControlNet_version/controlnet_flux.py", line 332, in forward encoder_hidden_states, hidden_states = block( ^^^^^^ File "/path/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1739, in _wrapped_call_impl return self._call_impl(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/path/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1750, in _call_impl return forward_call(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/uwuntu/code/projects/rm_obj_video/Omnieraser/ControlNet_version/transformer_flux.py", line 213, in forward attn_output, context_attn_output = self.attn( ^^^^^^^^^^ File "/path/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1739, in _wrapped_call_impl return self._call_impl(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/path/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1750, in _call_impl return forward_call(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/path/src/diffusers/src/diffusers/models/attention_processor.py", line 605, in forward return self.processor( ^^^^^^^^^^^^^^^ File "/path/src/diffusers/src/diffusers/models/attention_processor.py", line 2339, in call query = apply_rotary_emb(query, image_rotary_emb) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/path/src/diffusers/src/diffusers/models/embeddings.py", line 1197, in apply_rotary_emb cos, sin = freqs_cis[0], freqs_cis[1] # [S, D] #! monkey patched ~~~~~~~~~^^^ IndexError: index 1 is out of bounds for dimension 0 with size 1
requirements: torch --index-url https://download.pytorch.org/whl/cu118 torchvision --index-url https://download.pytorch.org/whl/cu118 tqdm safetensors tokenizers bitsandbytes numpy==1.24.3 accelerate==1.2.1 fastapi==0.115.6 gradio==3.49.0 tensorboard==2.17.0 transformers==4.42.0 -e git+https://github.com/huggingface/diffusers.git#egg=diffusers opencv-python==4.11.0.86 peft sentencepiece
but dont work with those (give first error)
Based on the traceback and the search results, the error ValueError: not enough values to unpack (expected 2, got 1) and IndexError: index 1 is out of bounds for dimension 0 with size 1 originates within the apply_rotary_emb function in the diffusers library, which is used by the Flux ControlNet model in your project.
This error occurs because the apply_rotary_emb function expects the freqs_cis tensor, which provides frequency information for Rotary Position Embeddings (RoPE), to contain two components (typically representing cosine and sine values) along a certain dimension. The error messages indicate that freqs_cis is not shaped as expected, specifically having a size of 1 where a size of 2 is required for unpacking or indexing.
This issue is likely due to an incompatibility or a bug in how positional embeddings are generated or handled within the specific version of the Flux ControlNet or pipeline code you are using, interacting with the version of the diffusers library from the main branch.
Here's a breakdown of the likely causes and potential solutions:
Incompatibility between diffusers main branch and the ControlNet/Flux implementation: The diffusers library, especially the main branch, is under active development. Changes to how RoPE is implemented or integrated with models like Flux and ControlNet might not be immediately compatible with older or specific custom implementations. Your use of -e git+https://github.com/huggingface/diffusers.git#egg=diffusers points to using the potentially unstable main branch.
diffusers that is known to be compatible with the Flux ControlNet model you are using. You might need to check the documentation or repository of the Omnieraser project or the specific ControlNet model to see if a recommended diffusers version is mentioned. You can install a specific version using pip install diffusers==<version_number>.Incorrect generation or passing of freqs_cis: The freqs_cis tensor is computed based on positional information before being passed to the apply_rotary_emb function. There might be an error in your custom script (gradio_controlnet_lora_flux.py or pipeline_flux_controlnet_removal.py) or within the ControlNet model implementation itself that results in freqs_cis having an incorrect shape or content. The monkey patch you attempted () suggests you observed that the dimension you expected to have size 2 actually had size 1.
cos, sin = freqs_cis[0], freqs_cis[1]controlnet call, particularly how positional embeddings or freqs_cis are generated or manipulated. Compare this to how RoPE is typically implemented in compatible diffusers pipelines (see search results [1, 4, 6] for examples). Debugging the shape and values of freqs_cis just before the error occurs can provide more insight.Interaction with other dependencies: While less likely to be the primary cause given the traceback, interactions between the specific versions of torch, diffusers, transformers, and accelerate could potentially contribute.
diffusers version doesn't work, you might need to experiment with slightly different versions of related libraries, though this can be complex.Recommended Action:
The most promising approach is to address the potential compatibility issue with the diffusers main branch. Try switching to a stable release of diffusers. If the issue persists, you will need to delve into the code responsible for preparing inputs to the ControlNet model and how freqs_cis is handled there. Debugging the freqs_cis tensor's shape and content is crucial for pinpointing the exact cause of the malformation.</version_number>