diff --git a/README.md b/README.md index 5f3edfb..1059c13 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,10 @@ own. The LoRA node starts with the identity LoRA selected in the edit workflow. (pose, framing, expression) in `prompt_text`. - `KREA TRANSFER.json` — face transfer between a source and a target picture. +### Face mask and reference position + +Edit ships a face/hair/neck mask into the patch `ref_boost_mask` with `ref_boost` 3, so identity is pulled from the face instead of the whole picture, and `ref_position = beside` lets the pose move away from the source layout. Both servers run ComfyUI with `--use-pytorch-cross-attention`, needed for masked reference attention on RTX 50. + ### Settings Use the `Krea` presets in the sampler list: FinePorn 8-10 steps, cfg 1, `euler`/`simple`; turbo checkpoints diff --git a/moss_nodes.py b/moss_nodes.py index 3f4aba6..f633c53 100644 --- a/moss_nodes.py +++ b/moss_nodes.py @@ -190,6 +190,7 @@ class PROMPTFORGE_KreaEditModelPatch: "source_latent_b": ("LATENT",), "ref_boost": ("FLOAT", {"default": 1.0, "min": 0.0, "max": 1000.0, "step": 0.01}), "ref_boost_a": ("FLOAT", {"default": 1.0, "min": 0.0, "max": 1000.0, "step": 0.01}), + "ref_boost_mask": ("MASK",), "fit_mode": (["fit", "crop (legacy)"], {"default": "fit"}), "vae": ("VAE",), "source_image": ("IMAGE",), @@ -204,10 +205,11 @@ class PROMPTFORGE_KreaEditModelPatch: def patch(self, model, source_latent, use_nag, nag_negative=None, source_latent_b=None, ref_boost=1.0, ref_boost_a=1.0, fit_mode="fit", vae=None, source_image=None, target_latent=None, - phi=4.0, tau=2.5, alpha=0.25, ref_position="aligned (trained)", ref_position_a="aligned (trained)"): + phi=4.0, tau=2.5, alpha=0.25, ref_position="aligned (trained)", ref_position_a="aligned (trained)", ref_boost_mask=None): common = dict(source_latent=source_latent, source_latent_b=source_latent_b, ref_boost=ref_boost, ref_boost_a=ref_boost_a, fit_mode=fit_mode, vae=vae, source_image=source_image, - target_latent=target_latent, ref_position=ref_position, ref_position_a=ref_position_a) + target_latent=target_latent, ref_position=ref_position, ref_position_a=ref_position_a, + ref_boost_mask=ref_boost_mask) rest = {key: value for key, value in common.items() if key != "source_latent"} if use_nag and nag_negative is not None: return comfy_nodes.NODE_CLASS_MAPPINGS["Krea2EditNormalizedAttentionGuidance"]().patch( diff --git a/pyproject.toml b/pyproject.toml index aa37be5..91537b1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "ComfyUI-PromptForge" description = "ComfyUI prompt enhancement suite: model/config node with GPU-aware auto settings, prompt enhancer with a preset catalog, and a standalone config finder." -version = "1.28.35" +version = "1.28.36" license = { file = "LICENSE" } dependencies = [ "transformers",