Skip to content
This repository was archived by the owner on Jul 16, 2025. It is now read-only.

Fix/typo - #88

Open
radiantjade wants to merge 2 commits into
google:mainfrom
radiantjade:fix/typo
Open

Fix/typo#88
radiantjade wants to merge 2 commits into
google:mainfrom
radiantjade:fix/typo

Conversation

@radiantjade

@radiantjade radiantjade commented May 14, 2024

Copy link
Copy Markdown

Fixed two critical typos in null_text_with_ptp.ipynb

1. 'x_t' was non existant on get_mask method :

class LocalBlend:
    def get_mask(self, maps, alpha, use_pool):
        k = 1
        maps = (maps * alpha).sum(-1).mean(1)
        if use_pool:
            maps = nnf.max_pool2d(maps, (k * 2 + 1, k * 2 +1), (1, 1), padding=(k, k))
        mask = nnf.interpolate(maps, size=(x_t.shape[2:]))  # omits error
class LocalBlend:
    def get_mask(self, maps, alpha, use_pool, x_t): 
        k = 1
        maps = (maps * alpha).sum(-1).mean(1)
        if use_pool:
            maps = nnf.max_pool2d(maps, (k * 2 + 1, k * 2 +1), (1, 1), padding=(k, k))
        mask = nnf.interpolate(maps, size=(x_t.shape[2:]))

2. Changed blend_word -> blend_words :

def make_controller(prompts: List[str], is_replace_controller: bool, cross_replace_steps: Dict[str, float], self_replace_steps: float, blend_words=None, equilizer_params=None) -> AttentionControlEdit:
    if blend_words is None:
        lb = None
    else:
        lb = LocalBlend(prompts, blend_word)  # omits error
def make_controller(prompts: List[str], is_replace_controller: bool, cross_replace_steps: Dict[str, float], self_replace_steps: float, blend_words=None, equilizer_params=None) -> AttentionControlEdit:
    if blend_words is None:
        lb = None
    else:
        lb = LocalBlend(prompts, blend_words) 

@google-cla

google-cla Bot commented May 14, 2024

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant