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

Black Images Generated #26

Open
saqibameen opened this issue Feb 16, 2024 · 2 comments
Open

Black Images Generated #26

saqibameen opened this issue Feb 16, 2024 · 2 comments

Comments

@saqibameen
Copy link

saqibameen commented Feb 16, 2024

When I try to run agentsd with stable diffusion v2.1, it generates black images. Sample below:

image

I have added agentsd folder to the root and following lines of code

  import agentsd
  if i == 0:
      agentsd.remove_patch(self.model)
      agentsd.apply_patch(self.model, sx=4, sy=4, ratio=0.4, agent_ratio=0.95, attn_precision="fp32")
  elif i == 20:
      agentsd.remove_patch(self.model)
      agentsd.apply_patch(self.model, sx=2, sy=2, ratio=0.4, agent_ratio=0.5, attn_precision="fp32")

to the ldm/models/diffusion/ddim.py file after L152 as per the instructions. Without this, it works fine.

@tian-qing001
Copy link
Collaborator

Hi @saqibameen. Thank you for your interest in our work. The appearance of black images may stem from unstable numerical values encountered on SDv2.1. Could you please confirm whether attn_precision="fp32" has been set?
This line.

@saqibameen
Copy link
Author

Hi @tian-qing001, thanks for the response. I did set that. Apparently, I had to manually change a couple of files in SDv1.2 to make it work. However, the inference time increased almost x2.

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

2 participants