fix: civitai picker

This commit is contained in:
bennykok 2024-01-28 22:08:31 +08:00
parent 757c587901
commit d96811a0c3
2 changed files with 4 additions and 2 deletions

View File

@ -27,7 +27,8 @@ export function mapModelsList(
description: item.description,
reference: "",
filename: v.files[0].name,
url: v.files[0].downloadUrl,
// Quick hack to get the download url back as normal url
url: `https://civitai.com/models/${v.modelId}?modelVersionId=${v.id}`, //v.files[0].downloadUrl,
} as z.infer<typeof Model>;
});
}),

View File

@ -61,7 +61,8 @@ function ModelPickerView({
}: Pick<AutoFormInputComponentProps, "field" | "fieldProps">) {
const customOverride = React.useMemo(() => {
const customOnChange = (value: z.infer<typeof ModelList>) => {
field.onChange(value[0]?.url);
const model = value[0];
field.onChange(model?.url);
};
return {
...field,