From cbc6bbdd701825adf6a1d29d6958962aa24f961d Mon Sep 17 00:00:00 2001 From: Jaret Burkett Date: Thu, 24 Sep 2026 08:40:16 -0600 Subject: [PATCH] Update ming image repo to new one --- .../diffusion_models/ming_image/ming_image.py | 6 +++--- .../ming_image/src/checkpoints.py | 21 ++++++++++++------- extensions_built_in/diffusion_models/ui.tsx | 2 +- testing/test_model_loading.py | 2 +- version.py | 2 +- 5 files changed, 20 insertions(+), 13 deletions(-) diff --git a/extensions_built_in/diffusion_models/ming_image/ming_image.py b/extensions_built_in/diffusion_models/ming_image/ming_image.py index 63a327d..ce3b062 100644 --- a/extensions_built_in/diffusion_models/ming_image/ming_image.py +++ b/extensions_built_in/diffusion_models/ming_image/ming_image.py @@ -41,7 +41,7 @@ from toolkit.samplers.custom_flowmatch_sampler import ( CustomFlowMatchEulerDiscreteScheduler, ) -from .src.checkpoints import BASE_REPO, COMFY_REPO +from .src.checkpoints import BASE_REPO, COMFY_REPO, canonical_repo from .src.pipeline import ( PIXELS_PER_TOKEN, VAE_SCALE_FACTOR, @@ -134,8 +134,8 @@ class MingImageModel(BaseModel): def load_model(self): dtype = self.torch_dtype self.print_and_status_update("Loading Ming-Image model") - model_path = self.model_config.name_or_path - extras_path = self.model_config.extras_name_or_path + model_path = canonical_repo(self.model_config.name_or_path) + extras_path = canonical_repo(self.model_config.extras_name_or_path) if extras_path == model_path and model_path.endswith(".safetensors"): # a single transformer file (a fine-tune): the rest comes from # the repack diff --git a/extensions_built_in/diffusion_models/ming_image/src/checkpoints.py b/extensions_built_in/diffusion_models/ming_image/src/checkpoints.py index e317e2c..3c97150 100644 --- a/extensions_built_in/diffusion_models/ming_image/src/checkpoints.py +++ b/extensions_built_in/diffusion_models/ming_image/src/checkpoints.py @@ -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, local comfy files or not. BASE_REPO is the vendor's diffusers-layout checkpoint; its configs, tokenizer, image processor and (until the repack -carries one) the vision tower are used with the repack. The repack tracks a -work-in-progress ComfyUI PR and is expected to move: change COMFY_REPO and the -UI default together. +carries one) the vision tower are used with the repack. The repack started +life under Kijai's account while its ComfyUI PR was in progress; that id is +rewritten to the Comfy-Org one (same files) so older configs keep working. """ 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 # 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"] +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): - """OstrisModelMixin candidate map: only the repack id resolves to these - files; every other name_or_path loads what it names.""" - return {COMFY_REPO: list(files)} + """OstrisModelMixin candidate map: only the repack id (current or legacy) + resolves to these files; every other name_or_path loads what it names.""" + return {repo: list(files) for repo in (COMFY_REPO, *LEGACY_COMFY_REPOS)} diff --git a/extensions_built_in/diffusion_models/ui.tsx b/extensions_built_in/diffusion_models/ui.tsx index d8ef92e..109e892 100644 --- a/extensions_built_in/diffusion_models/ui.tsx +++ b/extensions_built_in/diffusion_models/ui.tsx @@ -629,7 +629,7 @@ export const AI_TOOLKIT_UI_MODELS: ModelArch[] = [ // 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 "config.process[0].model.name_or_path": [ - "Kijai/Ming-Image-ComfyUI", + "Comfy-Org/Ming-Image", defaultNameOrPath, ], "config.process[0].model.quantize": [true, false], diff --git a/testing/test_model_loading.py b/testing/test_model_loading.py index f9daf44..d05af88 100644 --- a/testing/test_model_loading.py +++ b/testing/test_model_loading.py @@ -187,7 +187,7 @@ MODEL_TESTS = { }, "ming_image": { "model": { - "name_or_path": "Kijai/Ming-Image-ComfyUI", + "name_or_path": "Comfy-Org/Ming-Image", "quantize": True, "quantize_te": True, # the repack's int8 convrot files attach as-is at convrot8 diff --git a/version.py b/version.py index c4f5064..6993569 100644 --- a/version.py +++ b/version.py @@ -1 +1 @@ -VERSION = "0.13.21" +VERSION = "0.13.22"