stable-diffusion-webui icon indicating copy to clipboard operation
stable-diffusion-webui copied to clipboard

Improved default handling

Open blondon1 opened this issue 2 years ago • 0 comments

Description

  • using get with a default value directly in the attribute assignment simplifies the code and avoids the need for conditional checks later
  • self.alpha = weights.w.get("alpha", None) # alpha is constraint >>> self.rescale = weights.w.get('rescale', torch.tensor([1.0]))
  • reduce redundancy

Screenshots/videos:

Checklist:

blondon1 avatar Mar 04 '24 15:03 blondon1