Skip to content

Commit

Permalink
tidy(ui): remove extraneous zod schema
Browse files Browse the repository at this point in the history
  • Loading branch information
psychedelicious committed Apr 6, 2024
1 parent 3616470 commit eecb088
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 9 deletions.
3 changes: 1 addition & 2 deletions invokeai/frontend/web/src/features/metadata/util/parsers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ import {
isParameterHeight,
isParameterHRFEnabled,
isParameterHRFMethod,
isParameterInitialImage,
isParameterLoRAWeight,
isParameterNegativePrompt,
isParameterNegativeStylePromptSDXL,
Expand Down Expand Up @@ -140,7 +139,7 @@ const parseScheduler: MetadataParseFunc<ParameterScheduler> = (metadata) =>
getProperty(metadata, 'scheduler', isParameterScheduler);

const parseInitialImage: MetadataParseFunc<ImageDTO> = async (metadata) => {
const imageName = await getProperty(metadata, 'init_image', isParameterInitialImage);
const imageName = await getProperty(metadata, 'init_image', isString);
const imageDTORequest = getStore().dispatch(imagesApi.endpoints.getImageDTO.initiate(imageName));
const imageDTO = await imageDTORequest.unwrap();
imageDTORequest.unsubscribe();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,13 +126,6 @@ const zParameterT2IAdapterModel = zModelIdentifierField;
export type ParameterT2IAdapterModel = z.infer<typeof zParameterT2IAdapterModel>;
// #endregion

// #region I2I Initial Image
const zParameterInitialImage = z.string();
export type ParameterInitialImage = z.infer<typeof zParameterInitialImage>;
export const isParameterInitialImage = (val: unknown): val is ParameterInitialImage =>
zParameterInitialImage.safeParse(val).success;
// #endregion

// #region Strength (l2l strength)
const zParameterStrength = z.number().min(0).max(1);
export type ParameterStrength = z.infer<typeof zParameterStrength>;
Expand Down

0 comments on commit eecb088

Please sign in to comment.