invoke-ai / InvokeAI

InvokeAI 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, supports terminal use through a CLI, and serves as the foundation for multiple commercial products.
https://invoke-ai.github.io/InvokeAI/
Apache License 2.0
23.07k stars 2.39k forks source link

Add support for Spandrel Image-to-Image models (e.g. ESRGAN, Real-ESRGAN, Swin-IR, DAT, etc.) #6556

Closed RyanJDick closed 2 months ago

RyanJDick commented 3 months ago

Summary

Examples of supported models:

Related Issues

Closes #6394

QA Instructions

Merge Plan

Checklist

RyanJDick commented 2 months ago

Questions for reviewers:

  1. Currently, this new group of models is referred to as "Spandrel Image-to-Image Models" in the UI. Is there a better name? cc @hipsterusername
  2. @psychedelicious , I'd appreciate a review from you on this since I copied a bunch of frontend boilerplate for the new model type without taking the time to fully understand it all. Of note, I didn't add any spandrel types to the workflow V1 and V2 schema versions - is that ok?
  3. Are there any concerns with how we currently probe for this model type by loading the full model?
hipsterusername commented 2 months ago
  • @psychedelicious , I'd appreciate a review from you on this since I copied a bunch of frontend boilerplate for the new model type without taking the time to fully understand it all. Of note, I didn't add any spandrel types to the workflow V1 and V2 schema versions - is that ok?

  • Are there any concerns with how we currently probe for this model type by loading the full model?

It's a weird name. "Image Models", without naming spandrel?

RyanJDick commented 2 months ago

It's a weird name. "Image Models", without naming spandrel?

I renamed this class of models to Image-to-Image Models throughout the UI. (I assume that's what you meant?)

psychedelicious commented 2 months ago

@psychedelicious , I'd appreciate a review from you on this since I copied a bunch of frontend boilerplate for the new model type without taking the time to fully understand it all. Of note, I didn't add any spandrel types to the workflow V1 and V2 schema versions - is that ok?

Yep, that's fine. Those schemas exist for data migration purposes.

brandonrising commented 2 months ago

I was able to get it running and things were working great! I did try chaining 2 upscaling img2img nodes and the second one ran for 20 minutes and never finished. Maybe there's some kind of warning or limit we could set for max image size.

For this PR though, I think it's working really well!

RyanJDick commented 2 months ago

This PR is ready-to-go, but we are going to wait to merge it until we are confident that it can be released with low risk of rollback. It adds a new model type, which makes rollback non-trivial.

Also, https://github.com/invoke-ai/InvokeAI/pull/6594 should be merged as a fast-follow. They go hand-in-hand.

psychedelicious commented 2 months ago

Do you think we should deprecate the ESRGAN node?

RyanJDick commented 2 months ago

Do you think we should deprecate the ESRGAN node?

Yes, in a future PR that removes the use of that node from the starter workflows and for the upscale button.