Update ming image repo to new one
This commit is contained in:
1 parent
460c29ba9c
commit
cbc6bbdd70
5 files changed
+20
-13
No files matched your search
@@ -41,7 +41,7 @@ from toolkit.samplers.custom_flowmatch_sampler import (
|
|||||||
CustomFlowMatchEulerDiscreteScheduler,
|
CustomFlowMatchEulerDiscreteScheduler,
|
||||||
)
|
)
|
||||||
|
|
||||||
from .src.checkpoints import BASE_REPO, COMFY_REPO
|
from .src.checkpoints import BASE_REPO, COMFY_REPO, canonical_repo
|
||||||
from .src.pipeline import (
|
from .src.pipeline import (
|
||||||
PIXELS_PER_TOKEN,
|
PIXELS_PER_TOKEN,
|
||||||
VAE_SCALE_FACTOR,
|
VAE_SCALE_FACTOR,
|
||||||
@@ -134,8 +134,8 @@ class MingImageModel(BaseModel):
|
|||||||
def load_model(self):
|
def load_model(self):
|
||||||
dtype = self.torch_dtype
|
dtype = self.torch_dtype
|
||||||
self.print_and_status_update("Loading Ming-Image model")
|
self.print_and_status_update("Loading Ming-Image model")
|
||||||
model_path = self.model_config.name_or_path
|
model_path = canonical_repo(self.model_config.name_or_path)
|
||||||
extras_path = self.model_config.extras_name_or_path
|
extras_path = canonical_repo(self.model_config.extras_name_or_path)
|
||||||
if extras_path == model_path and model_path.endswith(".safetensors"):
|
if extras_path == model_path and model_path.endswith(".safetensors"):
|
||||||
# a single transformer file (a fine-tune): the rest comes from
|
# a single transformer file (a fine-tune): the rest comes from
|
||||||
# the repack
|
# the repack
|
||||||
|
|||||||
@@ -7,13 +7,15 @@ models folder win over the download. Anything else in `name_or_path` (the
|
|||||||
vendor repo, a local checkpoint, a fine-tune) loads exactly what it names,
|
vendor repo, a local checkpoint, a fine-tune) loads exactly what it names,
|
||||||
local comfy files or not. BASE_REPO is the vendor's diffusers-layout
|
local comfy files or not. BASE_REPO is the vendor's diffusers-layout
|
||||||
checkpoint; its configs, tokenizer, image processor and (until the repack
|
checkpoint; its configs, tokenizer, image processor and (until the repack
|
||||||
carries one) the vision tower are used with the repack. The repack tracks a
|
carries one) the vision tower are used with the repack. The repack started
|
||||||
work-in-progress ComfyUI PR and is expected to move: change COMFY_REPO and the
|
life under Kijai's account while its ComfyUI PR was in progress; that id is
|
||||||
UI default together.
|
rewritten to the Comfy-Org one (same files) so older configs keep working.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
BASE_REPO = "inclusionAI/Ming-Image-0.1-Design"
|
BASE_REPO = "inclusionAI/Ming-Image-0.1-Design"
|
||||||
COMFY_REPO = "Kijai/Ming-Image-ComfyUI"
|
COMFY_REPO = "Comfy-Org/Ming-Image"
|
||||||
|
# earlier home of the same files
|
||||||
|
LEGACY_COMFY_REPOS = {"Kijai/Ming-Image-ComfyUI": COMFY_REPO}
|
||||||
|
|
||||||
# repo-relative comfy files per component; the resolver orders them by the
|
# repo-relative comfy files per component; the resolver orders them by the
|
||||||
# requested qtype (convrot8 -> the int8 file, anything else -> bf16)
|
# requested qtype (convrot8 -> the int8 file, anything else -> bf16)
|
||||||
@@ -28,7 +30,12 @@ COMFY_TEXT_ENCODER_FILES = [
|
|||||||
COMFY_VAE_FILES = ["vae/ming_image_vae_bf16.safetensors"]
|
COMFY_VAE_FILES = ["vae/ming_image_vae_bf16.safetensors"]
|
||||||
|
|
||||||
|
|
||||||
|
def canonical_repo(name_or_path: str) -> str:
|
||||||
|
"""The current id for a repack that has moved; anything else unchanged."""
|
||||||
|
return LEGACY_COMFY_REPOS.get(name_or_path, name_or_path)
|
||||||
|
|
||||||
|
|
||||||
def comfy_weight_names(files):
|
def comfy_weight_names(files):
|
||||||
"""OstrisModelMixin candidate map: only the repack id resolves to these
|
"""OstrisModelMixin candidate map: only the repack id (current or legacy)
|
||||||
files; every other name_or_path loads what it names."""
|
resolves to these files; every other name_or_path loads what it names."""
|
||||||
return {COMFY_REPO: list(files)}
|
return {repo: list(files) for repo in (COMFY_REPO, *LEGACY_COMFY_REPOS)}
|
||||||
@@ -629,7 +629,7 @@ export const AI_TOOLKIT_UI_MODELS: ModelArch[] = [
|
|||||||
// the ComfyUI repack (local copies in the comfy models folder win over
|
// the ComfyUI repack (local copies in the comfy models folder win over
|
||||||
// the download); the vendor repo or a fine-tune here loads as named
|
// the download); the vendor repo or a fine-tune here loads as named
|
||||||
"config.process[0].model.name_or_path": [
|
"config.process[0].model.name_or_path": [
|
||||||
"Kijai/Ming-Image-ComfyUI",
|
"Comfy-Org/Ming-Image",
|
||||||
defaultNameOrPath,
|
defaultNameOrPath,
|
||||||
],
|
],
|
||||||
"config.process[0].model.quantize": [true, false],
|
"config.process[0].model.quantize": [true, false],
|
||||||
|
|||||||
@@ -187,7 +187,7 @@ MODEL_TESTS = {
|
|||||||
},
|
},
|
||||||
"ming_image": {
|
"ming_image": {
|
||||||
"model": {
|
"model": {
|
||||||
"name_or_path": "Kijai/Ming-Image-ComfyUI",
|
"name_or_path": "Comfy-Org/Ming-Image",
|
||||||
"quantize": True,
|
"quantize": True,
|
||||||
"quantize_te": True,
|
"quantize_te": True,
|
||||||
# the repack's int8 convrot files attach as-is at convrot8
|
# the repack's int8 convrot files attach as-is at convrot8
|
||||||
|
|||||||
+1
-1
@@ -1 +1 @@
|
|||||||
VERSION = "0.13.21"
|
VERSION = "0.13.22"
|
||||||
Reference in new issue
Block a user