google-genai>=0.5.0

Custom ComfyUI node(s) for generating images with Google Gemini and xAI Grok.
custom_nodes directory:cd /path/to/ComfyUI/custom_nodesgit clone https://github.com//ComfyUI-Better-Gemini.git uv (network required):uv syncuv pip install --python /path/to/ComfyUI/python/bin/python -e ./ComfyUI-Better-Geminiexport GOOGLE_API_KEY="..." (or GEMINI_API_KEY) for Geminiexport XAI_API_KEY="..." for GrokBetter Gemini (image)models.list()), prompt_images (optional), aspect ratio, resolution / width+height, temperature, top_p/top_k, max tokens, thinking difficulty, seed.IMAGE, STRING (any returned text / notes).Better Grok (image)/v1/image-generation-models when XAI_API_KEY is available), prompt_images (optional), aspect ratio, resolution, n.IMAGE, STRING (status / notes).google-genai lazily so ComfyUI can still boot even if dependencies aren’t installed yet; execution will raise a clear error until installed.comfy_entrypoint).model dropdown is populated via client.models.list() (filtered to models supporting generateContent). It requires an API key via GOOGLE_API_KEY/GEMINI_API_KEY; otherwise it falls back to bundled defaults and logs a warning: gemini-3.1-flash-image-preview, gemini-3-pro-image-preview, imagen-4.0-generate-001, imagen-4.0-ultra-generate-001.model dropdown is populated via xAI’s /v1/image-generation-models. It requires XAI_API_KEY; otherwise it falls back to bundled defaults and logs a warning: grok-imagine-image, grok-imagine-image-pro.seed to fit in an int32; larger ComfyUI seeds are deterministically folded via seed % 2**31.response_format="b64_json", so the node can return image tensors directly instead of downloading temporary URLs.User-Agent because api.x.ai can reject the default Python-urllib signature with Cloudflare 1010./v1/images/edits API and send ComfyUI IMAGE inputs as PNG data URIs. Multiple prompt images are supported for edit/merge workflows.resolution/aspect_ratio are best-effort (model-dependent). The node logs a warning if the returned size doesn’t match (no auto-resize).STRING output.uv sync --devuv run python -m unittest discover -s tests -p 'test_*.py' -v