mirror of
https://github.com/invoke-ai/InvokeAI
synced 2026-04-28 17:51:36 +02:00
Store CIELab_to_UPLab.icc within the repo
This commit is contained in:
parent
6a1efd3527
commit
991f63e455
@ -33,6 +33,7 @@ from invokeai.backend.image_util.composition import (
|
||||
srgb_from_okhsl,
|
||||
srgb_from_okhsv,
|
||||
tensor_from_pil_image,
|
||||
CIELAB_TO_UPLAB_ICC_PATH,
|
||||
)
|
||||
from invokeai.backend.stable_diffusion.diffusers_pipeline import image_resized_to_grid_as_tensor
|
||||
from invokeai.invocation_api import (
|
||||
@ -120,8 +121,8 @@ class InvokeAdjustImageHuePlusInvocation(BaseInvocation, WithMetadata, WithBoard
|
||||
if self.preserve_lightness or (space == "lch") or (space == "uplab"):
|
||||
profile_srgb = ImageCms.createProfile("sRGB")
|
||||
if space == "uplab":
|
||||
if os.path.isfile("CIELab_to_UPLab.icc"):
|
||||
profile_uplab = ImageCms.getOpenProfile("CIELab_to_UPLab.icc")
|
||||
with open(CIELAB_TO_UPLAB_ICC_PATH, "rb") as f:
|
||||
profile_uplab = ImageCms.getOpenProfile(f)
|
||||
if profile_uplab is None:
|
||||
profile_lab = ImageCms.createProfile("LAB", colorTemp=6500)
|
||||
else:
|
||||
|
||||
BIN
invokeai/backend/image_util/assets/CIELab_to_UPLab.icc
Normal file
BIN
invokeai/backend/image_util/assets/CIELab_to_UPLab.icc
Normal file
Binary file not shown.
@ -12,11 +12,13 @@ from typing import Literal, Optional
|
||||
|
||||
import torch
|
||||
from PIL import Image
|
||||
from pathlib import Path
|
||||
|
||||
from invokeai.backend.stable_diffusion.diffusers_pipeline import image_resized_to_grid_as_tensor
|
||||
|
||||
MAX_FLOAT = torch.finfo(torch.tensor(1.0).dtype).max
|
||||
|
||||
CIELAB_TO_UPLAB_ICC_PATH = Path(__file__).parent / "assets" / "CIELab_to_UPLab.icc"
|
||||
|
||||
def equivalent_achromatic_lightness(lch_tensor: torch.Tensor):
|
||||
"""Calculate Equivalent Achromatic Lightness accounting for Helmholtz-Kohlrausch effect"""
|
||||
|
||||
@ -164,7 +164,7 @@ version = { attr = "invokeai.version.__version__" }
|
||||
"*.png",
|
||||
]
|
||||
"invokeai.assets.fonts" = ["**/*.ttf"]
|
||||
"invokeai.backend" = ["**.png"]
|
||||
"invokeai.backend" = ["**.png", "**.icc"]
|
||||
"invokeai.configs" = ["*.example", "**/*.yaml", "*.txt"]
|
||||
"invokeai.frontend.web.dist" = ["**"]
|
||||
"invokeai.frontend.web.static" = ["**"]
|
||||
|
||||
Loading…
Reference in New Issue
Block a user