Prompt LLM Helper:
PromptProcessor uses a configured AI text service to turn a Chinese image-generation idea into English positive and negative prompts, along with Chinese translations of both. It asks the service to adapt its wording to the selected image-model family, preserve the original meaning, and use appropriate artistic and technical terms. This can help you prepare prompts for an image-generation workflow while checking the English wording against a Chinese translation. The results depend on the service’s response: the node extracts text from four labeled sections rather than independently verifying the quality or accuracy of the prompts.
Prompt LLM Helper Input Parameters:
chinese_prompt
Your original Chinese description of the image you want to create. The node sends it to the AI service with instructions to produce model-appropriate prompts and translations, so details about the subject, composition, lighting, and style can influence the result. This is a multiline string. Default: 请输入中文提示词 (“Please enter a Chinese prompt”); no minimum or maximum length is specified.
sd_model_type
The image-model family for which the prompts should be written. The node includes this choice in its request to the AI service, asking for suitable positive and negative wording; it does not change the service selected by model. Options: SD1.5, SDXL, and FLUX. No default is specified in the source.
model
The configured AI text model that processes your prompt. Its available options are loaded from the node’s config.json provider configuration, so the exact list depends on your installation. The selection determines the provider connection and model ID used for the request; it is separate from the image-model family selected under sd_model_type. No fixed options or default are specified in the source. A working provider configuration and access to the selected service are required.
system_prompt
Instructions sent to the AI service before your Chinese prompt. You can use them to guide the style or priorities of the response, but the response still needs the four labeled sections the node expects in order to extract the outputs. This is a multiline string. The default is a Chinese instruction asking a ComfyUI expert to convert Chinese prompts into English prompts suited to the specified model type, provide accurate matching Chinese translations, and generate negative prompts. No minimum or maximum length is specified.
api_key
The credential used to access the provider associated with model. If you leave it empty, the node looks for that provider’s API key in config.json; a nonempty value entered here takes priority when the client is initialized. Depending on the configuration’s auto_save_api_key setting, an entered key may also be saved to that file. This is a single-line string. Default: empty; no length limits are specified. Keep your key private, particularly if you share workflows or configuration files.
use_context
Controls whether the node includes stored conversation history in later requests and updates that history after a successful request. This can help maintain continuity when you refine prompts through repeated runs, but earlier exchanges may also influence a new result. Options: True or False. Default: False. With the default setting, stored history is not added to the request.
Prompt LLM Helper Output Parameters:
positive(en)
The English positive prompt extracted from the AI service’s response. It describes elements to include in the generated image and is the text you would typically pass to a positive-prompt field elsewhere in your workflow. This string is populated from the response’s [正向英文提示词] section; it may be empty if the expected sections cannot be parsed or the API request fails.
negative(en)
The English negative prompt extracted from the [负向英文提示词] section. It describes elements the AI service suggests avoiding, such as unwanted quality issues or distortions. This string can be used where your image-generation workflow accepts a negative prompt; an empty value may indicate a parsing problem or failed request. Whether a downstream image model uses negative prompts is determined by that workflow, not by this node.
positive(zhs)
The Chinese translation of the generated English positive prompt, extracted from [正向中文翻译]. It lets you review how the generated positive wording expresses your idea. It is a translation returned by the AI service, not a separate verification of accuracy, and may be empty if extraction or the request fails.
negative(zhs)
The Chinese translation of the generated English negative prompt, extracted from [负向中文翻译]. It helps you understand which unwanted elements the generated negative prompt describes. As with the other outputs, its wording depends on the AI service and it may be empty if extraction or the request fails.
Prompt LLM Helper Usage Tips:
- Replace the placeholder in
chinese_promptwith a specific description. Stating the subject, setting, composition, lighting, and desired style gives the AI service clearer material to work from. - Set
sd_model_typeto the image-model family you intend to use, then choose a separately configured and accessible AI text service undermodel. These selections serve different purposes. - Keep the four required section labels in the AI service’s response if you customize
system_prompt:[正向英文提示词],[正向中文翻译],[负向英文提示词], and[负向中文翻译]. Missing or changed labels can leave outputs empty. - Leave
use_contextoff for independent ideas. Turn it on when you want later runs to draw on recent exchanges, and check the results for details carried over from an earlier prompt. - Review both English prompts alongside their Chinese translations before using them. The node requests faithful translations, but it does not check whether the service followed those instructions.
- If you rely on a saved API key, confirm that it belongs to the provider selected under
model. If you enter a key in the node, be aware that configuration can allow it to be saved automatically.
Prompt LLM Helper Common Errors and Solutions:
加载配置文件失败: ...
- Explanation: The node could not read or parse its
config.jsonfile. It then uses a fallback configuration with no providers, which can leave themodellist empty. - Solution: Check that
config.jsonexists beside the node’s source, contains valid JSON, and is readable. Restore a valid provider configuration, then reload the node.
请提供有效的 `{provider}` API 密钥
- Explanation: No API key was supplied through
api_keyor found in the configuration for the selected provider. This error occurs while initializing the client. - Solution: Enter a valid key for that provider in
api_key, or add it to the provider’s configuration. Check thatmodelpoints to the intended provider.
保存配置文件失败: ...
- Explanation: Automatic API-key saving was enabled, but the node could not write the updated
config.jsonfile. The message is printed to the console. - Solution: Check that the configuration file and its folder are writable. If you do not want the key saved there, disable
auto_save_api_keyin the configuration.
API 请求失败: ...
- Explanation: The request or response-processing stage raised an exception. Possible causes include an inaccessible service, invalid credentials, provider-side limits, incompatible service settings, or an unexpected response. The node prints this message and returns four empty strings.
- Solution: Read the detail printed after the colon, then check your key, selected model, provider
base_url, network connection, and any configured proxy. Retry once the underlying issue is resolved.
ValueError: not enough values to unpack or too many values to unpack
- Explanation: The node splits the configured
modelvalue at underscores to identify its provider and model ID. A value that does not match the format expected by that split can cause an error before the API request is made. - Solution: Check the provider and model identifiers in
config.jsonand select a correctly configured model. If you maintain the configuration, note that this implementation expects a model selection it can split into exactly two parts.
Empty outputs with a printed 原始响应: ...
- Explanation: The service responded, but the node could not extract the requested sections. Its parser depends on the exact Chinese bracketed labels; it does not infer sections from differently formatted text.
- Solution: Inspect the printed response and restore the default
system_promptif you changed it. Ensure the service returns all four required labels in the expected order, then run the node again.
