chore: replace all cn comments of fe to en version by volc api (#320)
This commit is contained in:
@@ -24,7 +24,7 @@ export const PromptField = withField(
|
||||
const { name } = useField();
|
||||
const promptName = `${name}.prompt`;
|
||||
const negativePromptName = `${name}.negative_prompt`;
|
||||
// 保障和之前节点testID不变
|
||||
// Guarantee that the testID of the previous node remains unchanged
|
||||
const promptTestIDSuffix = name.replace('inputs.', '');
|
||||
const negativePromptTestIDSuffix = name.replace('inputs.', '');
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@ function isPreprocessorDisabled({
|
||||
}) {
|
||||
let disabled = false;
|
||||
|
||||
// 如果当前选项的预处理器已经被当前项选中 从allSelectedPreprocessor中移除
|
||||
// If the preprocessor for the current option is already selected by the current item, remove it from the allSelectedPreprocessor
|
||||
allSelectedPreprocessor = allSelectedPreprocessor.filter(
|
||||
item =>
|
||||
!(
|
||||
@@ -78,12 +78,12 @@ function isPreprocessorDisabled({
|
||||
),
|
||||
);
|
||||
|
||||
// 不能添加相同的模型
|
||||
// The same model cannot be added
|
||||
if (allSelectedPreprocessor.includes(currentOptionPreprocessor)) {
|
||||
disabled = true;
|
||||
}
|
||||
|
||||
// 1到4编号最多只能出现两个 4以上编号的模型不做限制
|
||||
// Numbers 1 to 4 can only appear at most two models with numbers above 4, and there is no limit.
|
||||
const group = [1, 2, 3, 4];
|
||||
if (group.includes(currentOptionPreprocessor)) {
|
||||
const isPreprocessorGroup =
|
||||
|
||||
@@ -34,13 +34,13 @@ import { type FormData } from './types';
|
||||
import { FormRender } from './form';
|
||||
|
||||
export const IMAGE_GENERATE_FORM_META: FormMetaV2<FormData> = {
|
||||
// 节点表单渲染
|
||||
// Node form rendering
|
||||
render: () => <FormRender />,
|
||||
|
||||
// 验证触发时机
|
||||
// verification trigger timing
|
||||
validateTrigger: ValidateTrigger.onChange,
|
||||
|
||||
// 验证规则
|
||||
// validation rules
|
||||
validate: {
|
||||
nodeMeta: nodeMetaValidate,
|
||||
['inputs.modelSetting.model']: ({ value, formValues }) => {
|
||||
@@ -51,13 +51,13 @@ export const IMAGE_GENERATE_FORM_META: FormMetaV2<FormData> = {
|
||||
6: [6, 7],
|
||||
};
|
||||
|
||||
// 获取references字段
|
||||
// Get references field
|
||||
const references = formValues?.inputs?.references || [];
|
||||
|
||||
// 获取value对应的无效preprocessor值数组
|
||||
// Gets an array of invalid preprocessor values corresponding to the value
|
||||
const invalidValues = invalidPreprocessors[value] || [];
|
||||
|
||||
// 检查references中的preprocessor是否包含无效值
|
||||
// Check if the preprocessor in the references contains invalid values
|
||||
for (const reference of references) {
|
||||
if (invalidValues.includes(reference?.preprocessor)) {
|
||||
return I18n.t('Imageflow_not_support');
|
||||
@@ -71,13 +71,13 @@ export const IMAGE_GENERATE_FORM_META: FormMetaV2<FormData> = {
|
||||
},
|
||||
},
|
||||
|
||||
// 副作用管理
|
||||
// Side effect management
|
||||
effect: {
|
||||
nodeMeta: fireNodeTitleChange,
|
||||
outputs: provideNodeOutputVariablesEffect,
|
||||
},
|
||||
|
||||
// 默认值
|
||||
// default value
|
||||
defaultValues: () => ({
|
||||
inputs: {
|
||||
modelSetting: {
|
||||
|
||||
@@ -42,8 +42,8 @@ export const FormRender = withNodeConfigForm(() => {
|
||||
);
|
||||
});
|
||||
|
||||
// 监听引用参考的模型变化触发模型设置的模型校验
|
||||
// 用useWatch目前无法监听引用模型 先监听整个表单值
|
||||
// Listening to referenced model changes triggers model validation for model settings
|
||||
// With useWatch, you can't currently listen to the reference model. Instead, listen to the entire form value first
|
||||
function useReferenceModelChangeEffect(callback: () => void) {
|
||||
const form = useForm<FormData>();
|
||||
const { values } = form;
|
||||
|
||||
Reference in New Issue
Block a user