threestudio icon indicating copy to clipboard operation
threestudio copied to clipboard

batch_size cannot be larger than 1 in controlnet guidance

Open dunbar12138 opened this issue 2 years ago • 2 comments

https://github.com/threestudio-project/threestudio/blob/94c6ad2a4e391e8a85ac28724870bcd515b9e591/threestudio/models/guidance/controlnet_guidance.py#L347

Hi, thanks for your great work. Just have a quick question: is there a specific reason that batch_size here cannot be larger than 1?

dunbar12138 avatar Jul 24 '23 23:07 dunbar12138

Hi, @dunbar12138. ControlNet support both SDS and DU(dataset update proposed by instructnerf2nerf). In the DU setting, ControlNet needs to define a scheduler with a random timestep to execute multiple sampling steps for obtaining an RGB image. If the batch size is not 1, the randomly generated tilmestep may differ within the same batch, which is not permissible for a single scheduler. However, if you are only utilizing the SDS loss, I believe you can comment out this code.

DSaurus avatar Jul 26 '23 14:07 DSaurus

Thanks for your reply! I'll test SDS loss with larger batch_size then

dunbar12138 avatar Aug 04 '23 17:08 dunbar12138