INNER CODE UNIT · Python

_append_entry

gokayfem/ComfyUI-fal-API · nodes/builder_node.py:71

def _append_entry(node_name: str, chain: str, entry: dict[str, Any]) -> str:
    """New JSON array string: entries from ``chain`` plus ``entry`` (no mutation)."""
    prior = _parse_chain(node_name, chain, list)
    return json.dumps([*prior, entry])


def _require(node_name: str, field: str, value: str) -> str:
    """Strip a required string field, raising when it is blank."""
    text = (value or "").strip()
    if not text:
        raise FalApiError(node_name, f"'{field}' is required and cannot be empty")
    return text


def _resolve_image_url(node_name: str, field: str, image: Any, url: str, required: bool) -> str:
    """A connected IMAGE wins (uploaded via fal storage); else the URL string."""
    if image is not None:
        return ImageUtils.upload_image(image)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…