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

Spandrel addition brakes restoration nodes using GFPGAN models #3594

Closed
Gourieff opened this issue May 28, 2024 · 12 comments
Closed

Spandrel addition brakes restoration nodes using GFPGAN models #3594

Gourieff opened this issue May 28, 2024 · 12 comments

Comments

@Gourieff
Copy link

Gourieff commented May 28, 2024

Hi guys!

When we try to restore any image with GFPGAN using face restoration nodes - we get a gray noise above the restored image

Issue appeared after this commit 8cfd677

334178502-3d55b347-5270-4ee2-b2f7-e6447e898ba1

Related Issue: Gourieff/comfyui-reactor-node#326

@shawnington
Copy link
Contributor

shawnington commented May 28, 2024

So it broke after a commit that deleted all of the code? 17,700+ deletions... I wonder why it's not working right. Just kidding.

It was a very large change, that replaced comfy functions with spandrel, and Im going to assume the issue is probably with spandrel, the code in the commit looks okay to me, at cursory glance without tracing the execution.

The actual code changes besides using spandrel are quite minor (considering 17k lines were deleted), and load from state dict is pretty universal, so I'd say it's probably a bug in spandrel related to that particular model.

This is the only real change.

 out = model_loading.load_state_dict(sd).eval()

to the spandrel version

 out = ModelLoader().load_from_state_dict(sd).eval()

outside of that the only change is

upscale_model.to("cpu")

which updates

upscale_model.cpu()

to use the currently preferented syntax with pytorch. x.cpu and x.cuda are deprecated in favor of x.to(device)

@shawnington
Copy link
Contributor

shawnington commented May 28, 2024

I hope this gets patched soon ! 💕

I hope there is an open issue with spandrel

@abkcehtnn
Copy link

thanks for posting this, I will wait for the update!

@xueqing0622
Copy link

same problem,

@abee717171
Copy link

abee717171 commented May 28, 2024

Any idea when this is going to be fixed? <3 my workflow stopped working :(

@Gourieff
Copy link
Author

Gourieff commented May 28, 2024

Any idea when this is going to be fixed? <3 my workflow stopped working :(

You can temporarily roll back to the commit ffc4b7c

  git checkout ffc4b7c

when you want to return back - just switch the branch to master

  git checkout master

@abkcehtnn
Copy link

Any idea when this is going to be fixed? <3 my workflow stopped working :(

You can temporarily roll back to the commit ffc4b7c

  git checkout ffc4b7c

when you want to return back - just switch the branch to master

  git checkout master

It worked for me! Thanks!

@igrekun
Copy link

igrekun commented Jun 2, 2024

It's not a problem with spandrel.

Previous code required images normalized to -1 +1 range. Spandrel models universally require 0..1 range.
Reactor needs to be updated.

@shawnington
Copy link
Contributor

知道什麼時候會修復這個問題嗎? <3我的工作流程停止工作:(

可以暫時回滾到提交ffc4b7c

  git checkout ffc4b7c

當你想返回時 - 只需將分支切換到 master

  git checkout master

這對我有用!謝謝!

This is an english language repo, please keep comments in english so that other people may benefit from them.

@lingkops4
Copy link

知道什麼時候會修復這個問題嗎? <3我的工作流程停止工作:(

可以暫時回滾到提交ffc4b7c

  git checkout ffc4b7c

當你想返回時 - 只需將分支切換到 master

  git checkout master

thx working

@devZu9
Copy link

devZu9 commented Jun 7, 2024

Hello!
How difficult is it to fix this in new releases? It's been so long, some of my processes use updates, but for GFPGAN to work I have to use the old release.
Maybe there is already some updated custom Reactor node?
Maybe it is possible to insert conditions where ComfyUI could work correctly with GFPGAN in both new and old releases?

@Gourieff
Copy link
Author

Fixed Gourieff/comfyui-reactor-node@a7ae669
Closing the Issue

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

No branches or pull requests

8 participants