feat(ml): auto-commit con 26 cambios

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-24 04:02:54 +02:00
parent ff41f4f053
commit c0b2dce3b0
26 changed files with 112 additions and 13 deletions
@@ -28,3 +28,11 @@ def test_control_image_modelo_y_strength():
apply_in = node_by_ct(wf, "ControlNetApply")["inputs"]
assert apply_in["strength"] == 0.65
assert node_by_ct(wf, "KSampler")["inputs"]["seed"] == 5
def test_determinista():
# Builder puro: misma entrada -> mismo dict (sin red, seed fijo, sin estado).
args = ("ck.safetensors", "pose.png", "control_openpose.pth", "POS", "NEG")
a = comfyui_build_controlnet_workflow(*args, strength=0.65, seed=5)
b = comfyui_build_controlnet_workflow(*args, strength=0.65, seed=5)
assert a == b
@@ -82,3 +82,11 @@ def test_invalid_base_type_raises():
comfyui_build_facedetailer_workflow(
123, ckpt_name="dreamshaper_8.safetensors", positive="face",
)
def test_determinista():
# Builder puro: misma entrada -> mismo dict (sin red, seed fijo, sin estado).
kw = dict(ckpt_name="dreamshaper_8.safetensors", positive="detailed face", seed=42)
a = comfyui_build_facedetailer_workflow("portrait_00001_.png", **kw)
b = comfyui_build_facedetailer_workflow("portrait_00001_.png", **kw)
assert a == b
@@ -48,3 +48,11 @@ def test_upscale_model_wired():
assert wf["11"]["class_type"] == "UpscaleModelLoader"
assert wf["11"]["inputs"]["model_name"] == "4x_foolhardy_Remacri.pth"
assert wf["12"]["inputs"]["upscale_model"] == ["11", 0]
def test_determinista():
# Builder puro: misma entrada -> mismo dict (sin red, seed fijo, sin estado).
kw = dict(ckpt_name="dreamshaper_8.safetensors", positive="a fox", seed=42)
a = comfyui_build_hires_fix_workflow(**kw)
b = comfyui_build_hires_fix_workflow(**kw)
assert a == b
@@ -56,3 +56,10 @@ def test_watertight_usa_voxeltomesh_surface_net():
assert wf["8"]["inputs"]["voxel"] == ["7", 0]
# El resto de la cadena no cambia: SaveGLB sigue colgando del nodo "8".
assert wf["9"]["inputs"]["mesh"] == ["8", 0]
def test_determinista():
# Builder puro: misma entrada -> mismo dict (sin red, seed fijo, sin estado).
a = comfyui_build_image_to_3d_workflow("obj.png", seed=42)
b = comfyui_build_image_to_3d_workflow("obj.png", seed=42)
assert a == b
@@ -28,3 +28,11 @@ def test_denoise_y_init_image():
assert ks["denoise"] == 0.45
assert ks["seed"] == 7
assert node_by_ct(wf, "LoadImage")["inputs"]["image"] == "init.png"
def test_determinista():
# Builder puro: misma entrada -> mismo dict (sin red, seed fijo, sin estado).
args = ("ck.safetensors", "init.png", "POS", "NEG")
a = comfyui_build_img2img_workflow(*args, seed=7)
b = comfyui_build_img2img_workflow(*args, seed=7)
assert a == b
@@ -29,3 +29,11 @@ def test_base_y_mascara_se_cargan():
assert mask == "m.png"
ks = node_by_ct(wf, "KSampler")["inputs"]
assert ks["seed"] == 33 and ks["denoise"] == 0.9
def test_determinista():
# Builder puro: misma entrada -> mismo dict (sin red, seed fijo, sin estado).
args = ("ck.safetensors", "img.png", "mask.png", "POS", "NEG")
a = comfyui_build_inpaint_workflow(*args, seed=33)
b = comfyui_build_inpaint_workflow(*args, seed=33)
assert a == b
@@ -31,3 +31,11 @@ def test_base_emite_ruido_sobrante_y_refiner_lo_recoge():
# Comparten el corte de pasos: el base termina donde declara base_steps.
assert base["end_at_step"] == 20
assert refiner["start_at_step"] == 20
def test_determinista():
# Builder puro: misma entrada -> mismo dict (sin red, seed fijo, sin estado).
args = ("base.st", "ref.st", "POS", "NEG")
a = comfyui_build_sdxl_refiner_workflow(*args, seed=9)
b = comfyui_build_sdxl_refiner_workflow(*args, seed=9)
assert a == b
@@ -78,3 +78,10 @@ def test_sin_upscale_omite_nodos_remacri():
def test_views_invalido_lanza_valueerror():
with pytest.raises(ValueError):
comfyui_build_textured_3d_multiview_workflow("ref.png", views=3)
def test_determinista():
# Builder puro: misma entrada -> mismo dict (sin red ni estado).
a = comfyui_build_textured_3d_multiview_workflow("ref.png", views=6)
b = comfyui_build_textured_3d_multiview_workflow("ref.png", views=6)
assert a == b
@@ -41,3 +41,11 @@ def test_params_se_reflejan_en_los_nodos():
def test_filename_prefix_en_saveimage():
wf = comfyui_build_txt2img_workflow("ck.safetensors", "POS", filename_prefix="demo_run")
assert node_by_ct(wf, "SaveImage")["inputs"]["filename_prefix"] == "demo_run"
def test_determinista():
# Builder puro: misma entrada -> mismo dict (sin red, seed fijo, sin estado).
args = ("ck.safetensors", "POS", "NEG")
a = comfyui_build_txt2img_workflow(*args, seed=123)
b = comfyui_build_txt2img_workflow(*args, seed=123)
assert a == b
@@ -26,3 +26,10 @@ def test_method_latent_no_usa_modelo():
assert "ImageScaleBy" in cts
assert "UpscaleModelLoader" not in cts
assert node_by_ct(wf, "LoadImage")["inputs"]["image"] == "img.png"
def test_determinista():
# Builder puro: misma entrada -> mismo dict (sin red ni estado).
a = comfyui_build_upscale_workflow("img.png", model_name="4x-UltraSharp.pth", method="model")
b = comfyui_build_upscale_workflow("img.png", model_name="4x-UltraSharp.pth", method="model")
assert a == b
@@ -89,3 +89,10 @@ def test_params_se_reflejan_wan():
def test_model_invalido_lanza_valueerror():
with pytest.raises(ValueError):
comfyui_build_video_workflow("x", model="sora")
def test_determinista():
# Builder puro: misma entrada -> mismo dict (sin red, seed fijo, sin estado).
a = comfyui_build_video_workflow("a fox running", model="ltx", seed=7)
b = comfyui_build_video_workflow("a fox running", model="ltx", seed=7)
assert a == b
@@ -24,3 +24,10 @@ def test_animation_usa_load3d_advanced():
wf = comfyui_build_view_3d_workflow("mesh.glb", animation=True)
assert class_types(wf) == {"Load3DAdvanced"}
assert node_by_ct(wf, "Load3DAdvanced")["inputs"]["model_file"] == "mesh.glb"
def test_determinista():
# Builder puro: misma entrada -> mismo dict (sin red ni estado).
a = comfyui_build_view_3d_workflow("mesh.glb", width=800, height=600)
b = comfyui_build_view_3d_workflow("mesh.glb", width=800, height=600)
assert a == b
@@ -43,3 +43,11 @@ def test_reconecta_el_ksampler_al_lora():
ks = next(n for n in inj.values() if n["class_type"] == "KSampler")
# El KSampler debe tomar el modelo del LoraLoader, no ya del checkpoint.
assert ks["inputs"]["model"][0] == lid
def test_determinista():
# Builder puro: misma base + mismos args -> mismo dict (deepcopy, sin estado).
base = comfyui_build_txt2img_workflow("ck.safetensors", "POS", "NEG")
a = comfyui_inject_lora(base, "style.safetensors")
b = comfyui_inject_lora(base, "style.safetensors")
assert a == b