fix bad math

This commit is contained in:
Damian at mba 2022-10-23 19:43:35 +02:00
parent 9210bf7d3a
commit 8e7d744c60
2 changed files with 2 additions and 4 deletions

View File

@ -1,4 +1,3 @@
import math
import string
from typing import Union
@ -140,7 +139,7 @@ class CrossAttentionControlSubstitute(CrossAttentionControlledFragment):
# and there is very little perceptible difference as s_end increases above 0.5
# so for shape_freedom = 0.5 we probably want s_end to be 0.2
# -> cube root and subtract from 1.0
merged_options.s_end = 1.0 - math.cbrt(shape_freedom)
merged_options['s_end'] = 1.0 - shape_freedom ** (1. / 3.)
print('converted shape_freedom argument to', merged_options)
merged_options.update(options)

View File

@ -1,4 +1,3 @@
from enum import Enum
from math import ceil
from typing import Callable, Optional
@ -83,7 +82,7 @@ class InvokeAIDiffuserComponent:
# flip because sigmas[0] is for the fully denoised image
# percent_through must be <1
percent_through = 1.0 - float(sigma_index.item() + 1) / float(self.model.sigmas.shape[0])
print('estimated percent_through', percent_through, 'from sigma', sigma)
print('estimated percent_through', percent_through, 'from sigma', sigma.item())
cross_attention_control_types_to_do = CrossAttentionControl.get_active_cross_attention_control_types_for_step(self.cross_attention_control_context, percent_through)
if len(cross_attention_control_types_to_do)==0: