brycedrennan/imaginAIry

AIMG is borked (Fatal error apon execution)

TheSystemGuy1337 opened this issue · 5 comments

I love defective software, don't you? Trying to run AIMG server results in an instant crash. This is the log

aimg server
' /home/thesystemguy/anaconda3/envs/ip2p/lib/python3.8/site-packages/pydantic/_internal/fields.py:126: UserWarning: Field "model_config_path" has conflict with protected namespace "model".

You may be able to resolve this warning by setting model_config['protected_namespaces'] = ().
warnings.warn(
Traceback (most recent call last):
File "/home/thesystemguy/anaconda3/envs/ip2p/bin/aimg", line 6, in
imaginairy.cli.main.aimg()
File "/home/thesystemguy/anaconda3/envs/ip2p/lib/python3.8/site-packages/click/core.py", line 1157, in call
return self.main(*args, **kwargs)
File "/home/thesystemguy/anaconda3/envs/ip2p/lib/python3.8/site-packages/click/core.py", line 1078, in main
rv = self.invoke(ctx)
File "/home/thesystemguy/anaconda3/envs/ip2p/lib/python3.8/site-packages/click_shell/core.py", line 164, in invoke
ret = super(Shell, self).invoke(ctx)
File "/home/thesystemguy/anaconda3/envs/ip2p/lib/python3.8/site-packages/click/core.py", line 1688, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/thesystemguy/anaconda3/envs/ip2p/lib/python3.8/site-packages/click/core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/thesystemguy/anaconda3/envs/ip2p/lib/python3.8/site-packages/click/core.py", line 783, in invoke
return __callback(*args, **kwargs)
File "/home/thesystemguy/anaconda3/envs/ip2p/lib/python3.8/site-packages/imaginairy/cli/run_api.py", line 13, in run_server_cmd
from imaginairy.http.app import app
File "/home/thesystemguy/anaconda3/envs/ip2p/lib/python3.8/site-packages/imaginairy/http/app.py", line 14, in
from imaginairy.http.stablestudio import routes
File "/home/thesystemguy/anaconda3/envs/ip2p/lib/python3.8/site-packages/imaginairy/http/stablestudio/routes.py", line 7, in
from imaginairy.http.stablestudio.models import (
File "/home/thesystemguy/anaconda3/envs/ip2p/lib/python3.8/site-packages/imaginairy/http/stablestudio/models.py", line 33, in
class StableStudioInputImage(BaseModel):
File "/home/thesystemguy/anaconda3/envs/ip2p/lib/python3.8/site-packages/pydantic/_internal/_model_construction.py", line 172, in new
complete_model_class(
File "/home/thesystemguy/anaconda3/envs/ip2p/lib/python3.8/site-packages/pydantic/_internal/_model_construction.py", line 420, in complete_model_class
schema = cls.get_pydantic_core_schema(cls, handler)
File "/home/thesystemguy/anaconda3/envs/ip2p/lib/python3.8/site-packages/pydantic/main.py", line 533, in get_pydantic_core_schema
return __handler(__source)
File "/home/thesystemguy/anaconda3/envs/ip2p/lib/python3.8/site-packages/pydantic/_internal/_schema_generation_shared.py", line 82, in call
schema = self._handler(__source_type)
File "/home/thesystemguy/anaconda3/envs/ip2p/lib/python3.8/site-packages/pydantic/_internal/_generate_schema.py", line 266, in generate_schema
return self._generate_schema_for_type(
File "/home/thesystemguy/anaconda3/envs/ip2p/lib/python3.8/site-packages/pydantic/_internal/_generate_schema.py", line 287, in _generate_schema_for_type
schema = self._generate_schema(obj)
File "/home/thesystemguy/anaconda3/envs/ip2p/lib/python3.8/site-packages/pydantic/_internal/_generate_schema.py", line 477, in _generate_schema
return self._model_schema(obj)
File "/home/thesystemguy/anaconda3/envs/ip2p/lib/python3.8/site-packages/pydantic/_internal/_generate_schema.py", line 353, in _model_schema
{k: self._generate_md_field_schema(k, v, decorators) for k, v in fields.items()},
File "/home/thesystemguy/anaconda3/envs/ip2p/lib/python3.8/site-packages/pydantic/_internal/_generate_schema.py", line 353, in
{k: self._generate_md_field_schema(k, v, decorators) for k, v in fields.items()},
File "/home/thesystemguy/anaconda3/envs/ip2p/lib/python3.8/site-packages/pydantic/_internal/_generate_schema.py", line 618, in _generate_md_field_schema
common_field = self._common_field_schema(name, field_info, decorators)
File "/home/thesystemguy/anaconda3/envs/ip2p/lib/python3.8/site-packages/pydantic/_internal/_generate_schema.py", line 660, in _common_field_schema
schema = self._apply_annotations(
File "/home/thesystemguy/anaconda3/envs/ip2p/lib/python3.8/site-packages/pydantic/_internal/_generate_schema.py", line 1318, in _apply_annotations
schema = get_inner_schema(source_type)
File "/home/thesystemguy/anaconda3/envs/ip2p/lib/python3.8/site-packages/pydantic/_internal/_schema_generation_shared.py", line 82, in call
schema = self._handler(__source_type)
File "/home/thesystemguy/anaconda3/envs/ip2p/lib/python3.8/site-packages/pydantic/_internal/_generate_schema.py", line 1279, in inner_handler
schema = self._generate_schema(obj)
File "/home/thesystemguy/anaconda3/envs/ip2p/lib/python3.8/site-packages/pydantic/_internal/_generate_schema.py", line 555, in _generate_schema
return self._union_schema(obj)
File "/home/thesystemguy/anaconda3/envs/ip2p/lib/python3.8/site-packages/pydantic/_internal/_generate_schema.py", line 737, in _union_schema
choices.append(self.generate_schema(arg))
File "/home/thesystemguy/anaconda3/envs/ip2p/lib/python3.8/site-packages/pydantic/_internal/_generate_schema.py", line 266, in generate_schema
return self._generate_schema_for_type(
File "/home/thesystemguy/anaconda3/envs/ip2p/lib/python3.8/site-packages/pydantic/_internal/_generate_schema.py", line 287, in _generate_schema_for_type
schema = self._generate_schema(obj)
File "/home/thesystemguy/anaconda3/envs/ip2p/lib/python3.8/site-packages/pydantic/_internal/_generate_schema.py", line 539, in _generate_schema
return self._arbitrary_type_schema(obj, obj)
File "/home/thesystemguy/anaconda3/envs/ip2p/lib/python3.8/site-packages/pydantic/_internal/_generate_schema.py", line 582, in _arbitrary_type_schema
raise PydanticSchemaGenerationError(
pydantic.errors.PydanticSchemaGenerationError: Unable to generate pydantic-core schema for <class 'imaginairy.http.utils.Base64Bytes'>. Set arbitrary_types_allowed=True in the model_config to ignore this error or implement __get_pydantic_core_schema__ on your type to fully support it.

If you got this error by calling handler() within __get_pydantic_core_schema__ then you likely need to call handler.generate_schema(<some type>) since we do not call __get_pydantic_core_schema__ on <some type> otherwise to avoid infinite recursion.

For further information visit https://errors.pydantic.dev/2.0.2/u/schema-for-unknown-type `

Also, I found that the safety filter steals too many CPU cycles (84.29s stolen), and I would like to either tone it down (reduce safety filter steps so that it steals 10 seconds rather than 80) or disarm it entirely (may not be possible as you have to appease the corporate overlords, blame them for all of your problems)

same here

I've had the same issues and hot-fixed them in PR #355. With this, after make run-dev, I can successfully start StableStudio and generate images.

Oh, and guys, I know that it can be frustrating at times, but please don't complain about "broken software", we all do this in our limited spare time ;)

Hey @dthuerck thank you very much for the reply! Oh, and please don't take it the wrong way, I genuinely appreciate the effort you've put into this. I was just hoping we could find a solution to the issue.

@hussbouta all good, no offense taken (this is not even my project after all, I just added this tiny fix ;) ).

thanks for being responsive here @dthuerck . Pydantic has been pinned to a compatible version in just released 13.1.0