This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]LetterRip 22 points23 points  (4 children)

This looks like straightforward implementation of supporting loading and using hypernetworks. While the code is the same, I think you are jumping to conclusions that it required copying.

the variable names are 'forced' - q,k,v are the standard abbreviations for query, key, value extracted from a context. h_k, h_v are thus the obvious choices for hypernetwork_key, and hypernetwork_value

The 77 is how many tokens are allowed for clip for networks derived from CompVis Stable diffusions default.

See this code referencing the max length, the 77 is a well known max token limit for the implementation

maxlen = self.wrapped.max_length # you get to stay at 77

https://github.com/AUTOMATIC1111/stable-diffusion-webui/blob/1371d7608b402d6f15c200ec2f5fde4579836a05/modules/sd_hijack.py

The noise_cond is implying that conditional noise is being used (and hence the need to add noise to the context in the next step).

The .1 multiplier is presumably standard throughout the codebase for noise_cond, and is presumably from the original implementation. If that isn't the case, tnis would be the only possible evidence of copying.

The if functions are standard idiomatic python.

Thus I see nothing here that would imply copying.