feat(tools): change base_resolution from dropdown to free numerical input
- Replaced the predefined dropdown list for `base_resolution` in `tools.py` with an open `INT` input (`min`: 128, `max`: 8192, `step`: 8) for the four Resolution Tools. - Updated `README.md` and `README_EN.md` to reflect the new user interface change.
This commit is contained in:
@@ -59,7 +59,7 @@ Nodos dedicados para calcular resoluciones estrictamente divisibles y proteger t
|
||||
- **`🎬 ResTool 64x (Hunyuan)`**: Múltiplos de 64. Base nativa ~921,600 px.
|
||||
|
||||
**Todas las herramientas comparten la misma interfaz:**
|
||||
- **Inputs:** `aspect_ratio` (ej. 16:9, 9:16), `base_resolution` (INT)
|
||||
- **Inputs:** `aspect_ratio` (ej. 16:9, 9:16), `base_resolution` (Campo numérico INT libre, puedes escribir el valor exacto que necesites, ej. 832 o 1024)
|
||||
- **Outputs:** `width` (INT), `height` (INT), `debug_info` (STRING)
|
||||
|
||||
> **🛡️ Escudo de Megapíxeles (NUEVO en v1.5.1):** Cada herramienta conoce el "suelo de entrenamiento" (Training Floor) de su modelo. Si solicitas una resolución extrema que cae por debajo del área mínima vital, el nodo escalará primero la resolución proporcionalmente hacia arriba para proteger la generación contra artefactos, y luego aplicará la divisibilidad estricta.
|
||||
|
||||
+1
-1
@@ -59,7 +59,7 @@ Dedicated nodes to calculate strictly divisible safe resolutions, shielding your
|
||||
- **`🎬 ResTool 64x (Hunyuan)`**: Multiples of 64. Native base ~921,600 px.
|
||||
|
||||
**All Tools share the same interface:**
|
||||
- **Inputs:** `aspect_ratio` (e.g. 16:9, 9:16), `base_resolution` (INT)
|
||||
- **Inputs:** `aspect_ratio` (e.g., 16:9, 9:16), `base_resolution` (Free INT numerical field, write the exact value you need, e.g., 832 or 1024)
|
||||
- **Outputs:** `width` (INT), `height` (INT), `debug_info` (STRING)
|
||||
|
||||
> **🛡️ Megapixel Shield (NEW in v1.5.1):** Each tool knows its model's "training floor" area. If you request an extreme aspect ratio that falls below this vital threshold, the node will first scale the resolution up proportionally to protect the generation against melting artifacts, and only then apply strict divisibility.
|
||||
|
||||
@@ -8,7 +8,8 @@ class BaseResolutionTool:
|
||||
return {
|
||||
"required": {
|
||||
"aspect_ratio": (["16:9", "9:16", "1:1", "4:3", "3:4", "21:9", "3:2", "2:3"],),
|
||||
"base_resolution": (["256", "360", "480", "512", "720", "768", "1024", "1080", "1280", "1440", "1920", "2048", "2160"], {"default": "1024"}),
|
||||
# 💡 Cambio clave: Dejamos de usar combo y pasamos a un campo INT libre
|
||||
"base_resolution": ("INT", {"default": 1024, "min": 128, "max": 8192, "step": 8}),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,7 +21,7 @@ class BaseResolutionTool:
|
||||
def get_resolution(self, aspect_ratio, base_resolution):
|
||||
div = self.DIVISOR
|
||||
min_pixels = getattr(self, "MIN_PIXELS", 0)
|
||||
longest_side = int(base_resolution)
|
||||
longest_side = int(base_resolution) # Mantenemos el casting por seguridad
|
||||
|
||||
w_str, h_str = aspect_ratio.split(':')
|
||||
w_ratio = float(w_str)
|
||||
@@ -81,4 +82,4 @@ class ResTool32x(BaseResolutionTool):
|
||||
@register_node
|
||||
class ResTool64x(BaseResolutionTool):
|
||||
DIVISOR = 64
|
||||
MIN_PIXELS = 921600 # Hunyuan (Equivale a 1280x720)
|
||||
MIN_PIXELS = 921600 # Hunyuan (Equivale a 1280x720)
|
||||
|
||||
Reference in New Issue
Block a user