ahrm / UnstableFusion

A Stable Diffusion desktop frontend with inpainting, img2img and more!
GNU General Public License v3.0
1.25k stars 86 forks source link

TypeError: Descriptors cannot not be created directly. #4

Closed ZeroCool22 closed 1 year ago

ZeroCool22 commented 1 year ago
C:\Users\ZeroCool22\Desktop\UnstableFusion\UnstableFusion>python unstablefusion.py
Traceback (most recent call last):
  File "C:\Users\ZeroCool22\Desktop\UnstableFusion\UnstableFusion\unstablefusion.py", line 7, in <module>
    from diffusionserver import StableDiffusionHandler
  File "C:\Users\ZeroCool22\Desktop\UnstableFusion\UnstableFusion\diffusionserver.py", line 4, in <module>
    from diffusers import StableDiffusionPipeline, StableDiffusionInpaintPipeline, StableDiffusionImg2ImgPipeline
  File "C:\Users\ZeroCool22\AppData\Local\Programs\Python\Python310\lib\site-packages\diffusers\__init__.py", line 26, in <module>
    from .pipelines import DDIMPipeline, DDPMPipeline, KarrasVePipeline, LDMPipeline, PNDMPipeline, ScoreSdeVePipeline
  File "C:\Users\ZeroCool22\AppData\Local\Programs\Python\Python310\lib\site-packages\diffusers\pipelines\__init__.py", line 11, in <module>
    from .latent_diffusion import LDMTextToImagePipeline
  File "C:\Users\ZeroCool22\AppData\Local\Programs\Python\Python310\lib\site-packages\diffusers\pipelines\latent_diffusion\__init__.py", line 6, in <module>
    from .pipeline_latent_diffusion import LDMBertModel, LDMTextToImagePipeline
  File "C:\Users\ZeroCool22\AppData\Local\Programs\Python\Python310\lib\site-packages\diffusers\pipelines\latent_diffusion\pipeline_latent_diffusion.py", line 12, in <module>
    from transformers.modeling_utils import PreTrainedModel
  File "C:\Users\ZeroCool22\AppData\Local\Programs\Python\Python310\lib\site-packages\transformers\modeling_utils.py", line 75, in <module>
    from accelerate import __version__ as accelerate_version
  File "C:\Users\ZeroCool22\AppData\Local\Programs\Python\Python310\lib\site-packages\accelerate\__init__.py", line 7, in <module>
    from .accelerator import Accelerator
  File "C:\Users\ZeroCool22\AppData\Local\Programs\Python\Python310\lib\site-packages\accelerate\accelerator.py", line 33, in <module>
    from .tracking import LOGGER_TYPE_TO_CLASS, GeneralTracker, filter_trackers
  File "C:\Users\ZeroCool22\AppData\Local\Programs\Python\Python310\lib\site-packages\accelerate\tracking.py", line 34, in <module>
    import wandb
  File "C:\Users\ZeroCool22\AppData\Local\Programs\Python\Python310\lib\site-packages\wandb\__init__.py", line 26, in <module>
    from wandb import sdk as wandb_sdk
  File "C:\Users\ZeroCool22\AppData\Local\Programs\Python\Python310\lib\site-packages\wandb\sdk\__init__.py", line 9, in <module>
    from .wandb_init import _attach, init  # noqa: F401
  File "C:\Users\ZeroCool22\AppData\Local\Programs\Python\Python310\lib\site-packages\wandb\sdk\wandb_init.py", line 30, in <module>
    from . import wandb_login, wandb_setup
  File "C:\Users\ZeroCool22\AppData\Local\Programs\Python\Python310\lib\site-packages\wandb\sdk\wandb_login.py", line 25, in <module>
    from .wandb_settings import Settings, Source
  File "C:\Users\ZeroCool22\AppData\Local\Programs\Python\Python310\lib\site-packages\wandb\sdk\wandb_settings.py", line 39, in <module>
    from wandb.sdk.wandb_setup import _EarlyLogger
  File "C:\Users\ZeroCool22\AppData\Local\Programs\Python\Python310\lib\site-packages\wandb\sdk\wandb_setup.py", line 22, in <module>
    from . import wandb_manager, wandb_settings
  File "C:\Users\ZeroCool22\AppData\Local\Programs\Python\Python310\lib\site-packages\wandb\sdk\wandb_manager.py", line 14, in <module>
    from wandb.sdk.lib.proto_util import settings_dict_from_pbmap
  File "C:\Users\ZeroCool22\AppData\Local\Programs\Python\Python310\lib\site-packages\wandb\sdk\lib\proto_util.py", line 6, in <module>
    from wandb.proto import wandb_internal_pb2 as pb
  File "C:\Users\ZeroCool22\AppData\Local\Programs\Python\Python310\lib\site-packages\wandb\proto\wandb_internal_pb2.py", line 15, in <module>
    from wandb.proto import wandb_base_pb2 as wandb_dot_proto_dot_wandb__base__pb2
  File "C:\Users\ZeroCool22\AppData\Local\Programs\Python\Python310\lib\site-packages\wandb\proto\wandb_base_pb2.py", line 36, in <module>
    _descriptor.FieldDescriptor(
  File "C:\Users\ZeroCool22\AppData\Local\Programs\Python\Python310\lib\site-packages\google\protobuf\descriptor.py", line 560, in __new__
    _message.Message._CheckCalledFromGeneratedFile()
TypeError: Descriptors cannot not be created directly.
If this call came from a _pb2.py file, your generated code is out of date and must be regenerated with protoc >= 3.19.0.
If you cannot immediately regenerate your protos, some other possible workarounds are:
 1. Downgrade the protobuf package to 3.20.x or lower.
 2. Set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python (but this will use pure-Python parsing and will be much slower).

More information: https://developers.google.com/protocol-buffers/docs/news/2022-05-06#python-updates

C:\Users\ZeroCool22\Desktop\UnstableFusion\UnstableFusion>
ahrm commented 1 year ago

Try pip install protobuf and see if the issue persists.

ZeroCool22 commented 1 year ago

Try pip install protobuf and see if the issue persists.

Screenshot_27

Say it's already installed, but i get same error.... :(

ahrm commented 1 year ago

Maybe try pip install protobuf==4.21.6?

ZeroCool22 commented 1 year ago

Maybe try pip install protobuf==4.21.6?

C:\Users\ZeroCool22\Desktop\UnstableFusion\UnstableFusion>pip install protobuf==4.21.6
Requirement already satisfied: protobuf==4.21.6 in c:\users\zerocool22\appdata\local\programs\python\python310\lib\site-packages (4.21.6)
ZeroCool22 commented 1 year ago

Should i downgrade version as the message said?

ahrm commented 1 year ago

It may be worth a try. But I have 4.21.6 myself.

ZeroCool22 commented 1 year ago

It may be worth a try. But I have 4.21.6 myself.

Can you tell me the correct command for downgrade?

ahrm commented 1 year ago

I think the issue might more likely be your other packages being outdated. Make sure your packages meet the minimum version in requirements.txt here: https://github.com/ahrm/UnstableFusion/blob/main/requirements.txt .

ZeroCool22 commented 1 year ago

I think the issue might more likely be your other packages being outdated. Make sure your packages meet the minimum version in requirements.txt here: https://github.com/ahrm/UnstableFusion/blob/main/requirements.txt .

I downgraded and now i get a different error:

C:``` \Users\ZeroCool22\Desktop\UnstableFusion\UnstableFusion>pip install --force-reinstall protobuf==3.20.1 Collecting protobuf==3.20.1 Using cached protobuf-3.20.1-cp310-cp310-win_amd64.whl (903 kB) Installing collected packages: protobuf Attempting uninstall: protobuf Found existing installation: protobuf 4.21.6 Uninstalling protobuf-4.21.6: Successfully uninstalled protobuf-4.21.6 Successfully installed protobuf-3.20.1

C:\Users\ZeroCool22\Desktop\UnstableFusion\UnstableFusion>python unstablefusion.py Traceback (most recent call last): File "C:\Users\ZeroCool22\Desktop\UnstableFusion\UnstableFusion\unstablefusion.py", line 936, in strength_widget, strength_slider, strength_text = create_slider_widget( File "C:\Users\ZeroCool22\Desktop\UnstableFusion\UnstableFusion\unstablefusion.py", line 805, in create_slider_widget strength_slider.setValue(default * 100) TypeError: setValue(self, int): argument 1 has unexpected type 'float'

ZeroCool22 commented 1 year ago

I think the issue might more likely be your other packages being outdated. Make sure your packages meet the minimum version in requirements.txt here: https://github.com/ahrm/UnstableFusion/blob/main/requirements.txt .

Yeah, i used the req.txt included on your repo when i cloned it.

ahrm commented 1 year ago

The new error should be fixed in the latest commits.

ZeroCool22 commented 1 year ago

The new error should be fixed in the latest commits.

Updated to last commit, but a new error now:

Screenshot_29

C:\Users\ZeroCool22\Desktop\UnstableFusion\UnstableFusion>python unstablefusion.py
Traceback (most recent call last):
  File "C:\Users\ZeroCool22\Desktop\UnstableFusion\UnstableFusion\unstablefusion.py", line 598, in paintEvent
    self.image_rect = QRect(offset_x, offset_y, w, h)
TypeError: arguments did not match any overloaded call:
  QRect(): too many arguments
  QRect(int, int, int, int): argument 1 has unexpected type 'float'
  QRect(QPoint, QPoint): argument 1 has unexpected type 'float'
  QRect(QPoint, QSize): argument 1 has unexpected type 'float'
  QRect(QRect): argument 1 has unexpected type 'float'

C:\Users\ZeroCool22\Desktop\UnstableFusion\UnstableFusion>
ahrm commented 1 year ago

It seems like the Qt version that you are using doesn't like float inputs. I will fix the issue soon, but I am curious on what is the version of your PyQt5?

ZeroCool22 commented 1 year ago

PyQt5

Screenshot_30

I hope that's the correct command to show the version, i don't know Python...

ahrm commented 1 year ago

This issue should also be fixed in the latest commits. Please inform me if there are still issues (and thanks for your feedback, a lot of users seem to have similar issues to yours so your feedback is very helpful).

ZeroCool22 commented 1 year ago

This issue should also be fixed in the latest commits. Please inform me if there are still issues (and thanks for your feedback, a lot of users seem to have similar issues to yours so your feedback is very helpful).

Working!:

Screenshot_31

Just one doubt, using protobuf-3.20.1 instead the last version will affect me in some way, like more slow process or something?

ahrm commented 1 year ago

I don't think so.

ZeroCool22 commented 1 year ago

I don't think so.

Thx!