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

Depth ControlNet not generating expected output #95

Open
LIU-Yuxin opened this issue Sep 12, 2024 · 5 comments
Open

Depth ControlNet not generating expected output #95

LIU-Yuxin opened this issue Sep 12, 2024 · 5 comments

Comments

@LIU-Yuxin
Copy link

LIU-Yuxin commented Sep 12, 2024

Thank you for the sharing the great work. I am currently using this method for generating textures given a mesh, by first rendering the depth images, and then generate the views with an additional reference image, similar to the one in the depth controlnet example, with depth images normalized as in #40. However, the quality of the generated image is not comparable to the image without controlnet, as shown below. Could you please let me know if there are any fix to this?

Input reference image:
sneakers
Output without controlnet:
output_wo
Rendered depth image (I assume the alpha channel is used for mask, and the opaque region should be normalized as in #40 ):
depth
Output with controlnet:
output_w

I have tried to adjust the size of the object, and also the weight of the controlnet, but did not generate result similar to the version without controlnet.

Similar issue also applies to face model and image.
face1
w/o
output
w/
output

Looking forward to hear your reply. Thank you!

@eliphatfs
Copy link
Collaborator

I think for the sneaker the control pose is different than the prior pose which may be causing a problem. For the head i am not sure.

@joeybchen
Copy link

Hi @LIU-Yuxin
Can I know how to get the depth maps for the objaverse data like you?
Many thanks!

@LIU-Yuxin
Copy link
Author

I think for the sneaker the control pose is different than the prior pose which may be causing a problem. For the head i am not sure.

#52 (comment)
According to this comment, I have removed the line of code related to initializing the EulerA scheduler from config:

pipeline.scheduler = EulerAncestralDiscreteScheduler.from_config(
pipeline.scheduler.config, timestep_spacing='trailing'
)

And the result start to appear correct.
depth
ref
output
May I ask if the scheduler and the trailing setting is chosen on purpose, and whether I am safe to remove it. (I would appreciate if you had any thoughts on the cause of this problem.)
Also, if the scheduler setting is not important, perhaps you could remove or adjust the setting as I saw many other users are facing similar issues when they use the default example code with their custom depth input. Thank you in advance.

@LIU-Yuxin
Copy link
Author

Hi @LIU-Yuxin Can I know how to get the depth maps for the objaverse data like you? Many thanks!

I am using Pytorch3D to render the geometry, and extract the z-buffer values, you may refer to facebookresearch/pytorch3d#35 for more information. You may also find more solutions like rendering with OpenGL lib, or use external 3D software like blender.
But the raw absolute depth may not be compatible with the controlnet, you can follow #40 (comment) to get a normalized depth.

@joeybchen
Copy link

Hi @LIU-Yuxin Can I know how to get the depth maps for the objaverse data like you? Many thanks!

I am using Pytorch3D to render the geometry, and extract the z-buffer values, you may refer to facebookresearch/pytorch3d#35 for more information. You may also find more solutions like rendering with OpenGL lib, or use external 3D software like blender. But the raw absolute depth may not be compatible with the controlnet, you can follow #40 (comment) to get a normalized depth.

Thank you so much!!!

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

3 participants