You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have been experimenting with custom weights for diffusion models, particularly focusing on generating human faces using the DiffusionPipeline from the diffusers library. However, even after loading the updated weights, there seems to be no appreciable change in the output.
Evaluate code
importtorchfromdiffusersimportDiffusionPipelinefolder_name="./train_3000"# Load the diffusion pipeline and move it to CUDApipe=DiffusionPipeline.from_pretrained(
"CompVis/stable-diffusion-v1-4", torch_dtype=torch.float16
).to("cuda")
old_params= {name: param.clone().to("cuda") forname, paraminpipe.unet.named_parameters()}
# Load your custom weights for UNet and textual inversion modulepipe.unet.load_attn_procs(
folder_name, weight_name="pytorch_custom_diffusion_weights.bin"
)
pipe.load_textual_inversion(folder_name, weight_name="<new1>.bin")
# Tensor to accumulate the changeschange=torch.tensor(0.0, device="cuda") # Ensure this is a floating point tensor to accumulate mean values# Compare the parameters after loading new weightsforname, new_paraminpipe.unet.named_parameters():
ifnameinold_params:
old_param=old_params[name]
# Calculate the mean absolute change and accumulate itchange+=torch.max(torch.abs(new_param-old_param))
print(change)
Describe the bug
I have been experimenting with custom weights for diffusion models, particularly focusing on generating human faces using the DiffusionPipeline from the
diffusers
library. However, even after loading the updated weights, there seems to be no appreciable change in the output.Evaluate code
Expected output
Some big tensor changes.
Actual output
tensor(0., device='cuda:0', grad_fn=<AddBackward0>)
The text was updated successfully, but these errors were encountered: