Nodes/ComfyUI-YogurtNodes/Grok Generate Text
ComfyUI Node

Grok Generate Text

Generate text using xAI API

By yogurt7771·Created 2 years ago·Updated 2 months ago· 0
Grok Generate Text
  • history
  • text
  • history
  • payload
api_key
base_url
model_namegrok-4
system_prompt
prompt
temperature1.00
top_p0.00
max_tokens4096
frequency_penalty0.00
presence_penalty0.00
retry_count1
chat_template<-system-> {{system_instruction}} <-/system-> <-user-> {{prompt}} <-/user->
proxy_url
seed-1
timeout0
extra{}
CategoryYogurtNodes/LLM

Inputs (17)

NameTypeDefaultDescription
api_keySTRINGAPI key for accessing xAI API
base_urlSTRINGBase URL for xAI API (leave blank for official API)
model_nameSTRINGgrok-4xAI text model name
system_promptSTRINGSystem-level prompt that affects the overall conversation style
promptSTRINGMain prompt content input by the user
temperatureFLOAT1.000–2Sampling temperature, higher values produce more random outputs
top_pFLOAT0.000–1Sampling probability threshold, controls output diversity
max_tokensINT40960–32768Maximum number of tokens in the generated text
frequency_penaltyFLOAT0.00-2–2Frequency penalty to reduce repetition
presence_penaltyFLOAT0.00-2–2Presence penalty to encourage new topics
retry_countINT11–10Number of retry attempts if the request fails
chat_templateSTRING<-system-> {{system_instruction}} <-/system-> <-user-> {{prompt}} <-/user->Content template for the generated text
proxy_urlSTRING代理URL,格式: protocol://user:pass@addr:port,支持http,https,socks5,socks5h
seedINT-1-1–2147483647Random seed for generation (-1 for random)
timeoutINT00–2147483647Timeout for the request in seconds, 0 means no timeout
historyoptHISTORY
extraoptSTRING{}Extra parameters for the request, in JSON format

Outputs (3)

NameTypeDescription
textSTRING
historyHISTORY
payload*