invoke-ai / InvokeAI

Invoke is a leading creative engine for Stable Diffusion models, empowering professionals, artists, and enthusiasts to generate and create visual media using the latest AI-driven technologies. The solution offers an industry leading WebUI, and serves as the foundation for multiple commercial products.
https://invoke-ai.github.io/InvokeAI/
Apache License 2.0
23.34k stars 2.4k forks source link

[bug]: Can't start up invokeai #5289

Closed coleintheville closed 9 months ago

coleintheville commented 10 months ago

Is there an existing issue for this?

OS

Windows

GPU

cuda

VRAM

No response

What version did you experience this issue on?

3.4 (latest)

What happened?

I was using Invoke 3.0 normally then I decided to update to the latest version, after trying to update with the script I was told that there was a problem with the permissions and the script couldn't update, I tried changing permissions in the folder that was stated by the script (at this point I can't remember which folder it was, I'm thinking it may have been .venv\Lib\site-packages, I changed permissions from Read & Write to Modify) after the change I couldn't start Invoke at all, I tried things from trying to repair the installation with the script to installing again on top of the existing installation, to installing fresh on a different drive, at this point I have 3 installs of Invoke (one is a fresh install, one is a backup copy of the og) with none of them working properly, the one whose script I copied and pasted here is my original install, the fresh install can run but when I open the web client I can't do anything, when I try to generate images I get a server error, and when I try to add an image I get a "can't upload image" popup, this here is the log when I try to run Invoke on my og install, what should I do?

Desired action:

  1. Generate images with the browser-based interface
  2. Explore InvokeAI nodes using a command-line interface
  3. Run textual inversion training
  4. Merge models (diffusers type only)
  5. Download and install models
  6. Change InvokeAI startup options
  7. Re-run the configure script to fix a broken install or to complete a major upgrade
  8. Open the developer console
  9. Update InvokeAI
  10. Command-line help Q - Quit Please enter 1-10, Q: [1] 1 Starting the InvokeAI browser-based UI.. A matching Triton is not available, some optimizations will not be enabled. Error caught was: No module named 'triton' [2023-12-14 02:20:09,401]::[InvokeAI]::INFO --> Loaded 0 modules from D:\InvokeAI folder 1 backup - Copy\nodes [2023-12-14 02:20:13,648]::[InvokeAI]::INFO --> Patchmatch initialized C:\Users\User\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\torchvision\transforms\functional_tensor.py:5: UserWarning: The torchvision.transforms.functional_tensor module is deprecated in 0.15 and will be removed in 0.17. Please don't rely on it. You probably just need to use APIs in torchvision.transforms.functional or in torchvision.transforms.v2.functional. warnings.warn( [2023-12-14 02:20:19,705]::[uvicorn.error]::INFO --> Started server process [18876] [2023-12-14 02:20:19,705]::[uvicorn.error]::INFO --> Waiting for application startup. [2023-12-14 02:20:19,706]::[InvokeAI]::INFO --> InvokeAI version 3.4.0post2 [2023-12-14 02:20:19,706]::[InvokeAI]::INFO --> Root directory = D:\InvokeAI folder 1 backup - Copy [2023-12-14 02:20:19,707]::[InvokeAI]::INFO --> Using database at D:\InvokeAI folder 1 backup - Copy\databases\invokeai.db [2023-12-14 02:20:19,712]::[InvokeAI]::INFO --> GPU device = cuda NVIDIA GeForce GTX 1080 [2023-12-14 02:20:19,739]::[InvokeAI]::INFO --> Scanning D:\InvokeAI folder 1 backup - Copy\models for new models [2023-12-14 02:20:20,206]::[InvokeAI]::INFO --> Scanned 29 files and directories, imported 0 models [2023-12-14 02:20:20,230]::[InvokeAI]::INFO --> Model manager service initialized [2023-12-14 02:20:20,237]::[uvicorn.error]::ERROR --> Traceback (most recent call last): File "C:\Users\User\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\starlette\routing.py", line 677, in lifespan async with self.lifespan_context(app) as maybe_state: File "C:\Users\User\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\starlette\routing.py", line 566, in aenter await self._router.startup() File "C:\Users\User\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\starlette\routing.py", line 654, in startup await handler() File "C:\Users\User\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\invokeai\app\api_app.py", line 96, in startup_event ApiDependencies.initialize(config=app_config, event_handler_id=event_handler_id, logger=logger) File "C:\Users\User\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\invokeai\app\api\dependencies.py", line 128, in initialize create_system_graphs(services.graph_library) File "C:\Users\User\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\invokeai\app\services\shared\default_graphs.py", line 83, in create_system_graphs text_to_image = graph_library.get(default_text_to_image_graph_id) File "C:\Users\User\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\invokeai\app\services\item_storage\item_storage_sqlite.py", line 82, in get return self._parse_item(result[0]) File "C:\Users\User\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\invokeai\app\services\item_storage\item_storage_sqlite.py", line 57, in _parse_item return self._validator.validate_json(item) File "C:\Users\User\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\pydantic\type_adapter.py", line 256, in validate_json return self.validator.validate_json(__data, strict=strict, context=context) pydantic_core._pydantic_core.ValidationError: 8 validation errors for LibraryGraph graph.nodes.width Input tag 'param_int' found using 'type' does not match any of the expected tags: 'float_math', 'cv_inpaint', 'i2l', 'pidi_image_processor', 'img_nsfw', 'float', 'hed_image_processor', 'img_channel_offset', 'sdxl_refiner_model_loader', 'img_hue_adjust', 'round_float', 'string_replace', 'mask_edge', 'step_param_easing', 'blank_image', 'lineart_image_processor', 'img_channel_multiply', 't2i_adapter', 't2l_onnx', 'leres_image_processor', 'infill_tile', 'latents_collection', 'range', 'midas_depth_image_processor', 'compel', 'save_image', 'color', 'img_scale', 'latents', 'integer', 'img_blur', 'infill_lama', 'add', 'normalbae_image_processor', 'infill_rgba', 'sdxl_model_loader', 'random_range', 'tomask', 'graph', 'mul', 'content_shuffle_image_processor', 'linear_ui_output', 'tile_image_processor', 'lresize', 'scheduler', 'string_split', 'mask_combine', 'face_identifier', 'string_collection', 'iterate', 'ip_adapter', 'clip_skip', 'img_chan', 'lora_loader', 'metadata_item', 'face_off', 'esrgan', 'infill_cv2', 'seamless', 'dynamic_prompt', 'prompt_onnx', 'sdxl_compel_prompt', 'img_lerp', 'div', 'controlnet', 'show_image', 'integer_collection', 'zoe_depth_image_processor', 'create_denoise_mask', 'main_model_loader', 'conditioning', 'string', 'img_watermark', 'segment_anything_processor', 'lblend', 'sdxl_refiner_compel_prompt', 'string_join', 'img_ilerp', 'collect', 'integer_math', 'canny_image_processor', 'string_split_neg', 'sdxl_lora_loader', 'img_conv', 'image_collection', 'onnx_model_loader', 'float_collection', 'boolean', 'lscale', 'openpose_image_processor', 'prompt_from_file', 'range_of_size', 'img_crop', 'img_resize', 'noise', 'metadata', 'color_map_image_processor', 'rand_float', 'lineart_anime_image_processor', 'img_mul', 'l2i_onnx', 'conditioning_collection', 'image', 'merge_metadata', 'denoise_latents', 'infill_patchmatch', 'string_join_three', 'freeu', 'color_correct', 'img_paste', 'face_mask_detection', 'mlsd_image_processor', 'rand_int', 'l2i', 'float_range', 'core_metadata', 'boolean_collection', 'float_to_int', 'mediapipe_face_processor', 'sub', 'vae_loader' [type=union_tag_invalid, input_value={'id': 'width', 'is_inter...: 'param_int', 'a': 512}, input_type=dict] For further information visit https://errors.pydantic.dev/2.5/v/union_tag_invalid graph.nodes.height Input tag 'param_int' found using 'type' does not match any of the expected tags: 'float_math', 'cv_inpaint', 'i2l', 'pidi_image_processor', 'img_nsfw', 'float', 'hed_image_processor', 'img_channel_offset', 'sdxl_refiner_model_loader', 'img_hue_adjust', 'round_float', 'string_replace', 'mask_edge', 'step_param_easing', 'blank_image', 'lineart_image_processor', 'img_channel_multiply', 't2i_adapter', 't2l_onnx', 'leres_image_processor', 'infill_tile', 'latents_collection', 'range', 'midas_depth_image_processor', 'compel', 'save_image', 'color', 'img_scale', 'latents', 'integer', 'img_blur', 'infill_lama', 'add', 'normalbae_image_processor', 'infill_rgba', 'sdxl_model_loader', 'random_range', 'tomask', 'graph', 'mul', 'content_shuffle_image_processor', 'linear_ui_output', 'tile_image_processor', 'lresize', 'scheduler', 'string_split', 'mask_combine', 'face_identifier', 'string_collection', 'iterate', 'ip_adapter', 'clip_skip', 'img_chan', 'lora_loader', 'metadata_item', 'face_off', 'esrgan', 'infill_cv2', 'seamless', 'dynamic_prompt', 'prompt_onnx', 'sdxl_compel_prompt', 'img_lerp', 'div', 'controlnet', 'show_image', 'integer_collection', 'zoe_depth_image_processor', 'create_denoise_mask', 'main_model_loader', 'conditioning', 'string', 'img_watermark', 'segment_anything_processor', 'lblend', 'sdxl_refiner_compel_prompt', 'string_join', 'img_ilerp', 'collect', 'integer_math', 'canny_image_processor', 'string_split_neg', 'sdxl_lora_loader', 'img_conv', 'image_collection', 'onnx_model_loader', 'float_collection', 'boolean', 'lscale', 'openpose_image_processor', 'prompt_from_file', 'range_of_size', 'img_crop', 'img_resize', 'noise', 'metadata', 'color_map_image_processor', 'rand_float', 'lineart_anime_image_processor', 'img_mul', 'l2i_onnx', 'conditioning_collection', 'image', 'merge_metadata', 'denoise_latents', 'infill_patchmatch', 'string_join_three', 'freeu', 'color_correct', 'img_paste', 'face_mask_detection', 'mlsd_image_processor', 'rand_int', 'l2i', 'float_range', 'core_metadata', 'boolean_collection', 'float_to_int', 'mediapipe_face_processor', 'sub', 'vae_loader' [type=union_tag_invalid, input_value={'id': 'height', 'is_inte...: 'param_int', 'a': 512}, input_type=dict] For further information visit https://errors.pydantic.dev/2.5/v/union_tag_invalid graph.nodes.seed Input tag 'param_int' found using 'type' does not match any of the expected tags: 'float_math', 'cv_inpaint', 'i2l', 'pidi_image_processor', 'img_nsfw', 'float', 'hed_image_processor', 'img_channel_offset', 'sdxl_refiner_model_loader', 'img_hue_adjust', 'round_float', 'string_replace', 'mask_edge', 'step_param_easing', 'blank_image', 'lineart_image_processor', 'img_channel_multiply', 't2i_adapter', 't2l_onnx', 'leres_image_processor', 'infill_tile', 'latents_collection', 'range', 'midas_depth_image_processor', 'compel', 'save_image', 'color', 'img_scale', 'latents', 'integer', 'img_blur', 'infill_lama', 'add', 'normalbae_image_processor', 'infill_rgba', 'sdxl_model_loader', 'random_range', 'tomask', 'graph', 'mul', 'content_shuffle_image_processor', 'linear_ui_output', 'tile_image_processor', 'lresize', 'scheduler', 'string_split', 'mask_combine', 'face_identifier', 'string_collection', 'iterate', 'ip_adapter', 'clip_skip', 'img_chan', 'lora_loader', 'metadata_item', 'face_off', 'esrgan', 'infill_cv2', 'seamless', 'dynamic_prompt', 'prompt_onnx', 'sdxl_compel_prompt', 'img_lerp', 'div', 'controlnet', 'show_image', 'integer_collection', 'zoe_depth_image_processor', 'create_denoise_mask', 'main_model_loader', 'conditioning', 'string', 'img_watermark', 'segment_anything_processor', 'lblend', 'sdxl_refiner_compel_prompt', 'string_join', 'img_ilerp', 'collect', 'integer_math', 'canny_image_processor', 'string_split_neg', 'sdxl_lora_loader', 'img_conv', 'image_collection', 'onnx_model_loader', 'float_collection', 'boolean', 'lscale', 'openpose_image_processor', 'prompt_from_file', 'range_of_size', 'img_crop', 'img_resize', 'noise', 'metadata', 'color_map_image_processor', 'rand_float', 'lineart_anime_image_processor', 'img_mul', 'l2i_onnx', 'conditioning_collection', 'image', 'merge_metadata', 'denoise_latents', 'infill_patchmatch', 'string_join_three', 'freeu', 'color_correct', 'img_paste', 'face_mask_detection', 'mlsd_image_processor', 'rand_int', 'l2i', 'float_range', 'core_metadata', 'boolean_collection', 'float_to_int', 'mediapipe_face_processor', 'sub', 'vae_loader' [type=union_tag_invalid, input_value={'id': 'seed', 'is_interm...': 'param_int', 'a': -1}, input_type=dict] For further information visit https://errors.pydantic.dev/2.5/v/union_tag_invalid graph.nodes.4.compel.clip Input should be an object [type=model_type, input_value=None, input_type=NoneType] For further information visit https://errors.pydantic.dev/2.5/v/model_type graph.nodes.5.compel.clip Input should be an object [type=model_type, input_value=None, input_type=NoneType] For further information visit https://errors.pydantic.dev/2.5/v/model_type graph.nodes.6 Input tag 't2l' found using 'type' does not match any of the expected tags: 'float_math', 'cv_inpaint', 'i2l', 'pidi_image_processor', 'img_nsfw', 'float', 'hed_image_processor', 'img_channel_offset', 'sdxl_refiner_model_loader', 'img_hue_adjust', 'round_float', 'string_replace', 'mask_edge', 'step_param_easing', 'blank_image', 'lineart_image_processor', 'img_channel_multiply', 't2i_adapter', 't2l_onnx', 'leres_image_processor', 'infill_tile', 'latents_collection', 'range', 'midas_depth_image_processor', 'compel', 'save_image', 'color', 'img_scale', 'latents', 'integer', 'img_blur', 'infill_lama', 'add', 'normalbae_image_processor', 'infill_rgba', 'sdxl_model_loader', 'random_range', 'tomask', 'graph', 'mul', 'content_shuffle_image_processor', 'linear_ui_output', 'tile_image_processor', 'lresize', 'scheduler', 'string_split', 'mask_combine', 'face_identifier', 'string_collection', 'iterate', 'ip_adapter', 'clip_skip', 'img_chan', 'lora_loader', 'metadata_item', 'face_off', 'esrgan', 'infill_cv2', 'seamless', 'dynamic_prompt', 'prompt_onnx', 'sdxl_compel_prompt', 'img_lerp', 'div', 'controlnet', 'show_image', 'integer_collection', 'zoe_depth_image_processor', 'create_denoise_mask', 'main_model_loader', 'conditioning', 'string', 'img_watermark', 'segment_anything_processor', 'lblend', 'sdxl_refiner_compel_prompt', 'string_join', 'img_ilerp', 'collect', 'integer_math', 'canny_image_processor', 'string_split_neg', 'sdxl_lora_loader', 'img_conv', 'image_collection', 'onnx_model_loader', 'float_collection', 'boolean', 'lscale', 'openpose_image_processor', 'prompt_from_file', 'range_of_size', 'img_crop', 'img_resize', 'noise', 'metadata', 'color_map_image_processor', 'rand_float', 'lineart_anime_image_processor', 'img_mul', 'l2i_onnx', 'conditioning_collection', 'image', 'merge_metadata', 'denoise_latents', 'infill_patchmatch', 'string_join_three', 'freeu', 'color_correct', 'img_paste', 'face_mask_detection', 'mlsd_image_processor', 'rand_int', 'l2i', 'float_range', 'core_metadata', 'boolean_collection', 'float_to_int', 'mediapipe_face_processor', 'sub', 'vae_loader' [type=union_tag_invalid, input_value={'id': '6', 'is_intermedi...: None, 'control': None}, input_type=dict] For further information visit https://errors.pydantic.dev/2.5/v/union_tag_invalid graph.nodes.7.l2i.latents Input should be an object [type=model_type, input_value=None, input_type=NoneType] For further information visit https://errors.pydantic.dev/2.5/v/model_type graph.nodes.7.l2i.vae Input should be an object [type=model_type, input_value=None, input_type=NoneType] For further information visit https://errors.pydantic.dev/2.5/v/model_type

[2023-12-14 02:20:20,239]::[uvicorn.error]::ERROR --> Application startup failed. Exiting. Task was destroyed but it is pending! task: <Task pending name='Task-3' coro=<FastAPIEventService.__dispatch_from_queue() running at C:\Users\User\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\invokeai\app\api\events.py:48> wait_for=> Desired action:

  1. Generate images with the browser-based interface
  2. Explore InvokeAI nodes using a command-line interface
  3. Run textual inversion training
  4. Merge models (diffusers type only)
  5. Download and install models
  6. Change InvokeAI startup options
  7. Re-run the configure script to fix a broken install or to complete a major upgrade
  8. Open the developer console
  9. Update InvokeAI
  10. Command-line help Q - Quit Please enter 1-10, Q: [1]

Screenshots

No response

Additional context

No response

Contact Details

mbarnathan commented 10 months ago

I ran into this during upgrade as well. For me, the permissions issue was caused by Invoke creating a temporary copy of the pydantic package (this is your issue if you see a path like ~ydantic), then trying to write to that copy while it was in use. Windows is going to complain about that. I was able to delete the temporary copy between when I started Invoke and when I updated, and that fixed the issue for me.

The output you see is the next issue I ran into. I think there's an incompatibility between the format of the default graph in InvokeAI's SQLite database and the current version of the app. Wiping the database completely does eliminate the error, but does not result in a successful startup. I'll update if I find a DB change that works.

mbarnathan commented 10 months ago

Truncating the graphs table will cause the default graphs to be recreated on the next invocation, and the errors will disappear. The remaining issue I'm having with my upgrade is a 404 on the / route, which seems to be independent of this.

That one is because the "dist" directory for the frontend is missing, and it will not populate a "/" route unless one exists.

mbarnathan commented 10 months ago

The frontend issue should be fixed when this PR ships: https://github.com/invoke-ai/InvokeAI/pull/5298

coleintheville commented 9 months ago

I appreciate you responding to me, excuse my ignorance but what do you mean by "when this PR ships"? What does PR stand for?, when will it ship and what will I have to do to fix my issue? You can probably tell I'm not very knowledgeable when it comes to this stuff so I hope you'll excuse me for that, and again, thanks for the help.

mbarnathan commented 9 months ago

PR is a pull request, a code change someone is proposing to the project. It has been accepted and merged into the main codebase, so it will ship with the next release of InvokeAI.

Millu commented 9 months ago

@mbarnathan the newest release candidate (3.5.0rc3) should have the fix for the missing frontend build

@coleintheville could you try re-installing the latest version of Invoke (3.4.0post2) again?

doktorsleepelss commented 9 months ago

I think I have the same problem. I get a "Server Error Not Found" message when I try to generate a new image. Happens with both v3.4.0post2 and 3.5.0rc3. Was previously using an older version (forgot which one), and it was working fine.

doktorsleepelss commented 9 months ago

Okay, I somehow fixed it. I previously used both chrome and edge to use invokeai back when it was working with an older version. And I got the error with both chrome and edge when I updated invoke.

I just tried firefox just now, which is a browser I never used invoke with before, and it finally worked fine. Then I went back to chrome and edge, and those browsers suddenly started working fine too. Maybe some weird browser cache thing was going on.

psychedelicious commented 9 months ago

The graph library validation errors will be resolved by #5331.