From 78c8e610904fa976aa306cd0305d493880630fe7 Mon Sep 17 00:00:00 2001 From: Brandon Thomas Date: Sun, 1 Oct 2023 04:22:26 -0400 Subject: [PATCH] add additional args --- .../face_animation/EnqueueFaceAnimation.ts | 5 ++ .../lipsync/LipsyncEditor/LipsyncEditor.tsx | 66 ++++++++++++------- 2 files changed, 47 insertions(+), 24 deletions(-) diff --git a/packages/components/src/api/face_animation/EnqueueFaceAnimation.ts b/packages/components/src/api/face_animation/EnqueueFaceAnimation.ts index 0beae23e82..8c404bab57 100644 --- a/packages/components/src/api/face_animation/EnqueueFaceAnimation.ts +++ b/packages/components/src/api/face_animation/EnqueueFaceAnimation.ts @@ -18,6 +18,11 @@ export interface EnqueueFaceAnimationRequest { audio_source: AudioSource, image_source: ImageSource, + + crop?: string, + make_still?: boolean, + high_quality?: boolean, + remove_watermark?: boolean, } // export interface EnqueueFaceAnimationSuccessResponse { diff --git a/packages/fakeyou.com/src/v2/view/pages/lipsync/LipsyncEditor/LipsyncEditor.tsx b/packages/fakeyou.com/src/v2/view/pages/lipsync/LipsyncEditor/LipsyncEditor.tsx index a51e461e48..86af634c81 100644 --- a/packages/fakeyou.com/src/v2/view/pages/lipsync/LipsyncEditor/LipsyncEditor.tsx +++ b/packages/fakeyou.com/src/v2/view/pages/lipsync/LipsyncEditor/LipsyncEditor.tsx @@ -38,16 +38,18 @@ interface LipSyncProps { cropping: any; imageProps: any; index: number; - orientation: any; - orientationChange: any; + highQuality: any; + highQualityChange: any; + still: any; + stillChange: any; style: any; toggle: any; enqueueInferenceJob: any; sessionSubscriptionsWrapper: any; t: any; inferenceJobsByCategory: any; - watermark: any; - watermarkChange: any; + removeWatermark: any; + removeWatermarkChange: any; } interface EditorProps { sessionSubscriptionsWrapper: SessionSubscriptionsWrapper; @@ -68,13 +70,15 @@ const InputPage = ({ cropping, cropChange, imageProps, - orientation, - orientationChange, + highQuality, + highQualityChange, + still, + stillChange, toggle, style, t, - watermark, - watermarkChange, + removeWatermark, + removeWatermarkChange, }: LipSyncProps) => { return @@ -87,13 +91,19 @@ const InputPage = ({ }} /> - - - - + + + + + - - + + + + + + + @@ -170,15 +180,17 @@ export default function LipsyncEditor({ const [animationStyle,animationStyleSet] = useState(0); - const [cropping,croppingSet] = useState("cropped"); - const [orientation,orientationSet] = useState("landscape"); - const [watermark,watermarkSet] = useState(false); + const [cropping,croppingSet] = useState("full"); + const [removeWatermark,removeWatermarkSet] = useState(false); + const [highQuality,highQualitySet] = useState(true); + const [still,stillSet] = useState(false); const animationChange = ({ target }: any) => animationStyleSet(target.value); const cropChange = ({ target }: any) => croppingSet(target.value); - const orientationChange = ({ target }: any) => orientationSet(target.value); - const watermarkChange = ({ target }: any) => watermarkSet(target.checked); - const clearInputs = () => { animationStyleSet(0); croppingSet("cropped"); orientationSet("landscape"); watermarkSet(false); } + const removeWatermarkChange = ({ target }: any) => removeWatermarkSet(target.checked); + const highQualityChange = ({ target }: any) => highQualitySet(target.checked); + const stillChange = ({ target }: any) => stillSet(target.checked); + const clearInputs = () => { animationStyleSet(0); croppingSet("crop"); removeWatermarkSet(false); } const makeRequest = (mode: number) => ({ uuid_idempotency_token: uuidv4(), @@ -219,6 +231,10 @@ export default function LipsyncEditor({ image_source: { maybe_media_upload_token: responses.image.upload_token, }, + crop: cropping, + make_still: still, + high_quality: highQuality, + remove_watermark: removeWatermark, }); } }) @@ -271,16 +287,18 @@ export default function LipsyncEditor({ cropping, enqueueInferenceJob, imageProps, - orientation, - orientationChange, + highQuality, + highQualityChange, + still, + stillChange, sessionSubscriptionsWrapper, inferenceJobsByCategory, index, t, toggle: { audio: readyMedia(1), image: readyMedia(0) }, style, - watermark, - watermarkChange, + removeWatermark, + removeWatermarkChange, }} /> ) : (