Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nodes phase 5: workflow saving and loading #4353

Merged
merged 34 commits into from
Aug 30, 2023
Merged

Conversation

psychedelicious
Copy link
Collaborator

What type of PR is this? (check all applicable)

  • Refactor
  • Feature
  • Bug Fix
  • Optimization
  • Documentation Update
  • Community Node Submission

Description

  • Workflows are saved to image files directly
  • Image-outputting nodes have an Embed Workflow checkbox which, if enabled, saves the workflow
  • BaseInvocation now has an workflow: Optional[str] field, so all nodes automatically have the field (but again only image-outputting nodes display this in UI)
  • If this field is enabled, when the graph is created, the workflow is stringified and set in this field
  • Nodes should add workflow=self.workflow when they save their output image to have the workflow written to the image
  • Uploads now have their metadata retained so that you can upload somebody else's image and have access to that workflow
  • Graphs are no longer saved to images, workflows replace them

TODO

  • Images created in the linear UI do not have a workflow saved yet. Need to write a function to build a workflow around the linear UI graph when using linear tabs. Unfortunately it will not have the nice positioning and size data the node editor gives you when you save a workflow... we'll have to figure out how to handle this.

Related Tickets & Documents

  • Related Issue #
  • Closes #

QA Instructions, Screenshots, Recordings

was causing failure to save images
…y) to decorator

All invocation metadata (type, title, tags and category) are now defined in decorators.

The decorators add the `type: Literal["invocation_type"]: "invocation_type"` field to the invocation.

Category is a new invocation metadata, but it is not used by the frontend just yet.

- `@invocation()` decorator for invocations

```py
@invocation(
    "sdxl_compel_prompt",
    title="SDXL Prompt",
    tags=["sdxl", "compel", "prompt"],
    category="conditioning",
)
class SDXLCompelPromptInvocation(BaseInvocation, SDXLPromptInvocationBase):
    ...
```

- `@invocation_output()` decorator for invocation outputs

```py
@invocation_output("clip_skip_output")
class ClipSkipInvocationOutput(BaseInvocationOutput):
    ...
```

- update invocation docs
- add category to decorator
- regen frontend types
@psychedelicious
Copy link
Collaborator Author

There's a circular dependency in the frontend code that I'm not going to get around to fixing. This can be force-merged.

@hipsterusername hipsterusername merged commit 2bd3cf2 into main Aug 30, 2023
7 of 8 checks passed
@hipsterusername hipsterusername deleted the feat/nodes-phase-5 branch August 30, 2023 19:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants