InvokeAI icon indicating copy to clipboard operation
InvokeAI copied to clipboard

[bug]: expanded graphs may create invalid nodes

Open psychedelicious opened this issue 2 years ago • 0 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

OS

Linux

GPU

cuda

VRAM

No response

What version did you experience this issue on?

main

What happened?

It's possible to soft-crash the engine by providing a graph that expands into an invalid graph. Two issues here:

  1. When a graph is expanded, it is not validated. If it expands to an invalid graph, the invalid graph is stored to the DB, then deserialized during invocation causing pydantic to fail.

  2. The exceptions raised in eg __process() in processory.py, inside the while loop at ~L38, are not caught properly. The situation in 1 above thus breaks the execution engine; the API is responsive but no further generations work.

This should be a pretty rare case, but there's a problem with how the UI does iterations and explicit seeds. It's possible to provide an explicit seed equal to (or close enough to) the max seed value, then the seed is incremented by one during graph expansion, until it is greater than the max allowed value. That's how I found this edge case.

Feels like something that is gonna be basically impossible to fully safeguard against in the UI.

Screenshots

No response

Additional context

No response

Contact Details

No response

psychedelicious avatar May 15 '23 03:05 psychedelicious