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)
You're encountering a common issue with rotary embeddings implementation in your object removal video application. This is happening in the attention mechanism where the rotary position embeddings (RoPE) are being applied.
The core problem is in the apply_rotary_emb function where it's trying to unpack a single value into two variables:
cos, sin = freqs_cis # [S, D] # This line expects freqs_cis to be a tuple/list with 2 elements
In your case, freqs_cis contains only a single tensor rather than the expected tuple of two tensors (cosine and sine components).
There are two potential fixes:
Locate the file /path/src/diffusers/src/diffusers/models/embeddings.py and modify line 1197. Change:
cos, sin = freqs_cis # [S, D]
To:
# Handle both single tensor and tuple cases
if isinstance(freqs_cis, (list, tuple)) and len(freqs_cis) >= 2:
cos, sin = freqs_cis[0], freqs_cis[1] # Original format
else:
# If it's a single tensor, split it in half along the last dimension
dim = freqs_cis.shape[-1] // 2
cos, sin = freqs_cis[..., :dim], freqs_cis[..., dim:]
If you're developing the custom ControlNet Flux implementation, ensure the rotary embeddings are correctly formatted before passing to the attention processor.
Your error is likely due to incompatibility between:
controlnet_flux.py, transformer_flux.py, etc.)Pin specific versions: Instead of using -e git+https://github.com/huggingface/diffusers.git#egg=diffusers, try a stable version:
diffusers==0.26.3
Check for updates: Look for any updates to the Omnieraser project that might address this compatibility issue.
Implement the monkey patch: The second error shows an attempted fix with freqs_cis[0], freqs_cis[1] which failed because freqs_cis doesn't have a second element. Modify this to properly handle the structure of your freqs_cis tensor.
This error occurs in rotary position embeddings processing which is crucial for the attention mechanism in your image processing pipeline. Fixing this will allow your object removal system to work correctly.