prompt:
CivitaiXGuardModerationPrompt is a specialized node designed to facilitate the moderation of prompts within the Civitai ecosystem. Its primary function is to analyze and evaluate prompts using the xGuardModeration recipe, ensuring that content adheres to specified guidelines and standards. This node is particularly beneficial for AI artists and developers who need to ensure that their generated content is appropriate and compliant with community or platform rules. By leveraging Civitai's orchestration capabilities, the node provides a robust framework for prompt moderation, offering insights into potential issues and enabling users to make informed decisions about their content. The node's integration with Civitai's moderation tools ensures a seamless and efficient process, making it an essential component for maintaining content quality and compliance.
prompt Input Parameters:
labels_json
This parameter allows you to specify an optional label filter in JSON format. When provided, only the named labels are evaluated, and any labels not found in the defaults or label overrides are ignored. This is useful for focusing the moderation process on specific areas of concern. The default value is an empty string, meaning all labels are evaluated if this parameter is omitted.
label_overrides_json
This parameter accepts JSON input for optional label configuration overrides. It merges with or overrides the default settings from the XGuardModerationOptionsGrain for the given mode. This allows for customization of the moderation process to better fit specific needs or contexts. The default value is an empty string.
store_full_response
A boolean parameter that, when set to true, stores the full raw chat completion response, including the complete logprobs.content array, in the destination blob. This is intended for debugging purposes, allowing for a detailed inspection of classification decisions. The default value is false, and enabling this option increases the storage size significantly, so it should not be used in normal traffic.
positive_prompt
This string parameter is used to input the positive prompt that you want to evaluate. It serves as the main content that the moderation process will analyze. The default value is an empty string.
negative_prompt
This string parameter allows you to specify a negative prompt to evaluate. It provides additional context or contrast to the positive prompt, helping to refine the moderation process. The default value is an empty string.
instructions
This parameter accepts a string of additional instructions or context for the moderation evaluation. It can guide the moderation process by providing specific directives or considerations. The default value is an empty string.
prompt Output Parameters:
results
This output provides the moderation results in JSON format. It contains detailed information about the evaluation of the prompt, including any issues or concerns identified during the process.
signal_metadata
This JSON output contains metadata related to the moderation signals. It provides additional context and information about the moderation process, helping to understand the basis of the evaluation.
blocked
A string output that indicates whether the prompt was blocked during the moderation process. This provides a clear and straightforward indication of the prompt's compliance with the moderation criteria.
triggered_labels
This JSON output lists the labels that were triggered during the moderation process. It helps identify specific areas of concern or non-compliance within the prompt.
workflow_id
This string output provides the ID of the workflow used during the moderation process. It is useful for tracking and referencing the specific moderation instance.
raw_json
This output contains the raw JSON response from the moderation process. It provides a comprehensive view of all data and results generated during the evaluation, useful for in-depth analysis and debugging.
prompt Usage Tips:
- Customize the
labels_jsonandlabel_overrides_jsonparameters to focus the moderation process on specific areas of concern, ensuring more relevant and targeted evaluations. - Use the
store_full_responseparameter sparingly, as it significantly increases storage size. Enable it only for debugging purposes to gain insights into the moderation process. - Provide clear and concise
instructionsto guide the moderation process, ensuring that the evaluation aligns with your specific needs and expectations.
prompt Common Errors and Solutions:
Invalid JSON Format
- Explanation: This error occurs when the input for
labels_jsonorlabel_overrides_jsonis not in a valid JSON format. - Solution: Ensure that the JSON input is correctly formatted, with proper syntax and structure. Use a JSON validator to check for errors before inputting the data.
Missing Positive Prompt
- Explanation: The
positive_promptparameter is required for the moderation process, and an error occurs if it is not provided. - Solution: Ensure that you input a valid string for the
positive_promptparameter before running the moderation process.
Excessive Storage Usage
- Explanation: Enabling
store_full_responsecan lead to excessive storage usage due to the large size of the stored data. - Solution: Disable the
store_full_responseparameter for regular operations and enable it only when detailed debugging is necessary.
