fix: remove advanced agrs in image

This commit is contained in:
jialin
2025-12-17 16:15:34 +08:00
parent da1efa9270
commit 30536cb04a
2 changed files with 17 additions and 2 deletions
@@ -95,6 +95,7 @@ const AddModal: React.FC<AddModalProps> = (props) => {
const axiosToken = useRef<any>(null); const axiosToken = useRef<any>(null);
const selectSpecRef = useRef<CatalogSpec>({} as CatalogSpec); const selectSpecRef = useRef<CatalogSpec>({} as CatalogSpec);
const specListRef = useRef<any[]>([]); const specListRef = useRef<any[]>([]);
const noCompatibleGPUsRef = useRef<boolean>(false);
const handleSumit = () => { const handleSumit = () => {
form.current?.submit?.(); form.current?.submit?.();
@@ -142,6 +143,10 @@ const AddModal: React.FC<AddModalProps> = (props) => {
}; };
const handleCheckCompatibility = async (formData: FormData) => { const handleCheckCompatibility = async (formData: FormData) => {
// no compatible gpus, do nothing
if (noCompatibleGPUsRef.current) {
return;
}
handleDoEvalute(formData); handleDoEvalute(formData);
}; };
@@ -165,6 +170,11 @@ const AddModal: React.FC<AddModalProps> = (props) => {
..._.omit(selectSpecRef.current, ['name']), ..._.omit(selectSpecRef.current, ['name']),
...allValues ...allValues
}; };
// no compatible gpus, do nothing
if (noCompatibleGPUsRef.current) {
return;
}
handleOnValuesChange?.({ handleOnValuesChange?.({
changedValues, changedValues,
allValues: data, allValues: data,
@@ -254,6 +264,7 @@ const AddModal: React.FC<AddModalProps> = (props) => {
// If no avaliable gpus for the model, show warning message // If no avaliable gpus for the model, show warning message
if (!res.items.length) { if (!res.items.length) {
noCompatibleGPUsRef.current = true;
setWarningStatus({ setWarningStatus({
show: true, show: true,
type: 'warning', type: 'warning',
@@ -261,6 +272,7 @@ const AddModal: React.FC<AddModalProps> = (props) => {
}); });
return; return;
} }
noCompatibleGPUsRef.current = false;
handleCheckCompatibility(allValues); handleCheckCompatibility(allValues);
} catch (error) { } catch (error) {
// ignore // ignore
+5 -2
View File
@@ -309,7 +309,7 @@ export const ImageconstExtraConfig: ParamsSchema[] = [
} }
]; ];
export const ImageAdvancedParamsConfig: ParamsSchema[] = [ const advancedConfig = [
{ {
type: 'Select', type: 'Select',
name: 'sample_method', name: 'sample_method',
@@ -458,7 +458,10 @@ export const ImageAdvancedParamsConfig: ParamsSchema[] = [
required: false required: false
} }
] ]
}, }
];
export const ImageAdvancedParamsConfig: ParamsSchema[] = [
{ {
type: 'InputNumber', type: 'InputNumber',
name: 'seed', name: 'seed',