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

feat: write-only canvas metadata #6404

Merged
merged 4 commits into from
May 20, 2024
Merged

Conversation

psychedelicious
Copy link
Collaborator

Summary

Store canvas objects in the metadata for both images generated by canvas graphs and images created when clicking the Save to Gallery button.

Canvas objects (images, brush strokes, shapes, masks, etc) are stored as is. There is no recall capability - this is planned only for a future canvas v2, based on the control layers renderer and state management.

Related Issues / Discussions

I don't think we've had any requests for canvas metadata without the ability to recall, so this doesn't resolve any open issues.

QA Instructions

  • Generate on canvas. Every generation, in every mode - txt2img, img2img, inpaint, outpaint, sd1 & sdxl - should have a _canvas_objects property in the metadata.
  • Click Save to Gallery on canvas after generating. Should have _canvas_objects property in the metadata.

Merge Plan

n/a

Checklist

  • The PR has a short but descriptive title, suitable for a changelog
  • Tests added / updated (if applicable)
  • Documentation added / updated (if applicable)

Canvas images are saved by uploading a blob generated from the HTML canvas element. This means the existing metadata handling, inside the graph execution engine, is not available.

To save metadata to canvas images, we need to provide it when uploading that blob.

The upload route now has a `metadata` body param. If this is provided, we use it over any metadata embedded in the image.
@github-actions github-actions bot added api python PRs that change python files frontend PRs that change frontend files labels May 19, 2024
@psychedelicious psychedelicious changed the title feat: canvas metadata feat: write-only canvas metadata May 19, 2024
@psychedelicious psychedelicious merged commit f4625c2 into main May 20, 2024
14 checks passed
@psychedelicious psychedelicious deleted the psyche/feat/canvas-metadata branch May 20, 2024 00:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api frontend PRs that change frontend files python PRs that change python files
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants