mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
fix bad math
This commit is contained in:
parent
9210bf7d3a
commit
8e7d744c60
@ -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)
|
||||
|
||||
|
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user