C0untFloyd / roop-unleashed

Evolved Fork of roop with Web Server and lots of additions
GNU Affero General Public License v3.0
2.32k stars 539 forks source link

Text Masking gives error #340

Closed antonythopking closed 1 year ago

antonythopking commented 1 year ago

Describe the bug Error comes up if I check the 'Use Text Masking' box on the Face Swap tab. Everything else works if this is left unchecked. Error message: cannot access local variable 'class_' where it is not associated with a value

To Reproduce Steps to reproduce the behavior:

  1. Go to 'Face Swap Tab'
  2. Click on 'Use Text Masking'
  3. Enter word/words separated by comma
  4. See error

Details What OS are you using?

Are you using a GPU?

Which version of roop unleashed are you using? roop unleashed 3.3.4

Screenshots Screenshot 2023-11-14 at 2 37 59 PM

This what I get after running run.py

Using provider [] - Device:cpu /opt/homebrew/lib/python3.11/site-packages/gradio/components/dropdown.py:231: UserWarning: The value passed into gr.Dropdown() is not in the list of choices. Please update the list of choices to include: cuda or set allow_custom_value=True. warnings.warn( Running on local URL: http://127.0.0.1:7860

To create a public link, set share=True in launch().

This what happens when after loading images then running with 'use text masking' checked

Applied providers: ['CPUExecutionProvider'], with options: {'CPUExecutionProvider': {}} find model: /Users/antony/.insightface/models/buffalo_l/1k3d68.onnx landmark_3d_68 ['None', 3, 192, 192] 0.0 1.0 Applied providers: ['CPUExecutionProvider'], with options: {'CPUExecutionProvider': {}} find model: /Users/antony/.insightface/models/buffalo_l/2d106det.onnx landmark_2d_106 ['None', 3, 192, 192] 0.0 1.0 Applied providers: ['CPUExecutionProvider'], with options: {'CPUExecutionProvider': {}} find model: /Users/antony/.insightface/models/buffalo_l/det_10g.onnx detection [1, 3, '?', '?'] 127.5 128.0 Applied providers: ['CPUExecutionProvider'], with options: {'CPUExecutionProvider': {}} find model: /Users/antony/.insightface/models/buffalo_l/genderage.onnx genderage ['None', 3, 96, 96] 0.0 1.0 Applied providers: ['CPUExecutionProvider'], with options: {'CPUExecutionProvider': {}} find model: /Users/antony/.insightface/models/buffalo_l/w600k_r50.onnx recognition ['None', 3, 112, 112] 127.5 127.5 set det-size: (640, 640) /opt/homebrew/lib/python3.11/site-packages/gradio/components/slider.py:150: UserWarning: Using the update method is deprecated. Simply return a new object instead, e.g. return gr.Slider(...) instead of return gr.Slider.update(...). warnings.warn( /opt/homebrew/lib/python3.11/site-packages/gradio/components/dropdown.py:176: UserWarning: Using the update method is deprecated. Simply return a new object instead, e.g. return gr.Dropdown(...) instead of return gr.Dropdown.update(...). warnings.warn( /opt/homebrew/lib/python3.11/site-packages/gradio/components/button.py:89: UserWarning: Using the update method is deprecated. Simply return a new object instead, e.g. return gr.Button(...) instead of return gr.Button.update(...). warnings.warn( Sorting videos/images Sorting videos/images Applied providers: ['CPUExecutionProvider'], with options: {'CPUExecutionProvider': {}} inswapper-shape: [1, 3, 128, 128] Module roop.processors.Mask_Clip2Seg does not exist Traceback (most recent call last): File "/opt/homebrew/lib/python3.11/site-packages/gradio/queueing.py", line 407, in call_prediction output = await route_utils.call_process_api( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/lib/python3.11/site-packages/gradio/route_utils.py", line 226, in call_process_api output = await app.get_blocks().process_api( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/lib/python3.11/site-packages/gradio/blocks.py", line 1550, in process_api result = await self.call_function( ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/lib/python3.11/site-packages/gradio/blocks.py", line 1199, in call_function prediction = await utils.async_iteration(iterator) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/lib/python3.11/site-packages/gradio/utils.py", line 519, in async_iteration return await iterator.anext() ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/lib/python3.11/site-packages/gradio/utils.py", line 512, in anext return await anyio.to_thread.run_sync( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/lib/python3.11/site-packages/anyio/to_thread.py", line 33, in run_sync return await get_asynclib().run_sync_in_worker_thread( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 877, in run_sync_in_worker_thread return await future ^^^^^^^^^^^^ File "/opt/homebrew/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 807, in run result = context.run(func, args) ^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/lib/python3.11/site-packages/gradio/utils.py", line 495, in run_sync_iterator_async return next(iterator) ^^^^^^^^^^^^^^ File "/opt/homebrew/lib/python3.11/site-packages/gradio/utils.py", line 649, in gen_wrapper yield from f(args, **kwargs) File "/Users/antony/roop-unleashed/ui/tabs/faceswap_tab.py", line 503, in start_swap batch_process(list_files_process, use_clip, clip_text, processing_method == "In-Memory processing", progress) File "/Users/antony/roop-unleashed/roop/core.py", line 249, in batch_process process_mgr.initialize(roop.globals.INPUT_FACESETS, roop.globals.TARGET_FACES, options) File "/Users/antony/roop-unleashed/roop/ProcessMgr.py", line 86, in initialize p = str_to_class(module, classname) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/antony/roop-unleashed/roop/utilities.py", line 217, in str_toclass return class or None ^^^^^^ UnboundLocalError: cannot access local variable 'class_' where it is not associated with a value

antonythopking commented 1 year ago

Nevermind, figured it out. Was missing torchvision and clipseg. Installed both and works great now!