mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
feat(nodes): extract LATENT_SCALE_FACTOR to constants.py
This commit is contained in:
parent
b7ffd36cc6
commit
ba7b1b2665
7
invokeai/app/invocations/constants.py
Normal file
7
invokeai/app/invocations/constants.py
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
LATENT_SCALE_FACTOR = 8
|
||||||
|
"""
|
||||||
|
HACK: Many nodes are currently hard-coded to use a fixed latent scale factor of 8. This is fragile, and will need to
|
||||||
|
be addressed if future models use a different latent scale factor. Also, note that there may be places where the scale
|
||||||
|
factor is hard-coded to a literal '8' rather than using this constant.
|
||||||
|
The ratio of image:latent dimensions is LATENT_SCALE_FACTOR:1, or 8:1.
|
||||||
|
"""
|
@ -23,6 +23,7 @@ from diffusers.schedulers import SchedulerMixin as Scheduler
|
|||||||
from pydantic import field_validator
|
from pydantic import field_validator
|
||||||
from torchvision.transforms.functional import resize as tv_resize
|
from torchvision.transforms.functional import resize as tv_resize
|
||||||
|
|
||||||
|
from invokeai.app.invocations.constants import LATENT_SCALE_FACTOR
|
||||||
from invokeai.app.invocations.fields import (
|
from invokeai.app.invocations.fields import (
|
||||||
ConditioningField,
|
ConditioningField,
|
||||||
DenoiseMaskField,
|
DenoiseMaskField,
|
||||||
@ -79,12 +80,6 @@ DEFAULT_PRECISION = choose_precision(choose_torch_device())
|
|||||||
|
|
||||||
SAMPLER_NAME_VALUES = Literal[tuple(SCHEDULER_MAP.keys())]
|
SAMPLER_NAME_VALUES = Literal[tuple(SCHEDULER_MAP.keys())]
|
||||||
|
|
||||||
# HACK: Many nodes are currently hard-coded to use a fixed latent scale factor of 8. This is fragile, and will need to
|
|
||||||
# be addressed if future models use a different latent scale factor. Also, note that there may be places where the scale
|
|
||||||
# factor is hard-coded to a literal '8' rather than using this constant.
|
|
||||||
# The ratio of image:latent dimensions is LATENT_SCALE_FACTOR:1, or 8:1.
|
|
||||||
LATENT_SCALE_FACTOR = 8
|
|
||||||
|
|
||||||
|
|
||||||
@invocation_output("scheduler_output")
|
@invocation_output("scheduler_output")
|
||||||
class SchedulerOutput(BaseInvocationOutput):
|
class SchedulerOutput(BaseInvocationOutput):
|
||||||
|
@ -3,7 +3,7 @@ from typing import Union
|
|||||||
|
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
|
||||||
from invokeai.app.invocations.latent import LATENT_SCALE_FACTOR
|
from invokeai.app.invocations.constants import LATENT_SCALE_FACTOR
|
||||||
from invokeai.backend.tiles.utils import TBLR, Tile, paste, seam_blend
|
from invokeai.backend.tiles.utils import TBLR, Tile, paste, seam_blend
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user