diff --git a/packages/components/src/api/_common/enums/WeightCategory.ts b/packages/components/src/api/_common/enums/WeightCategory.ts index e0c256eb67..834ed7b43f 100644 --- a/packages/components/src/api/_common/enums/WeightCategory.ts +++ b/packages/components/src/api/_common/enums/WeightCategory.ts @@ -4,4 +4,5 @@ export enum WeightCategory { VC = "voice_conversion", ZS = "zero_shot", SD = "image_generation", + WF = "workflow_config", } diff --git a/packages/components/src/api/video_workflow/UploadWorkflow.ts b/packages/components/src/api/video_workflow/UploadWorkflow.ts new file mode 100644 index 0000000000..cd50933de5 --- /dev/null +++ b/packages/components/src/api/video_workflow/UploadWorkflow.ts @@ -0,0 +1,28 @@ +import MakeRequest from "../MakeRequest"; + +export interface UploadWorkflowRequest { + uuid_idempotency_token: String, + + google_drive_link: String, + title: String, + description: String, + commit_hash?: String + creator_set_visibility: String + + // maybe_lora_upload_path?: String, + // maybe_name: String, + // maybe_description: String, + // visibility: String, + // maybe_cover_image_media_file_token?: String, +} + +export interface UploadWorkflowResponse { + success: boolean, + // maybe_sd_model_token?: String, + // maybe_lora_model_token?: String, +} + +export const UploadWorkflow = MakeRequest({ + method: "POST", + routingFunction: () => "/v1/workflow/upload/prompt", +}); diff --git a/packages/fakeyou.com/package.json b/packages/fakeyou.com/package.json index 42897d0898..03fc975caa 100644 --- a/packages/fakeyou.com/package.json +++ b/packages/fakeyou.com/package.json @@ -59,6 +59,7 @@ "react": "^16.13.1", "react-audio-voice-recorder": "^1.0.5", "react-autocomplete": "^1.8.1", + "react-device-detect": "^2.2.3", "react-dom": "^16.13.1", "react-drag-drop-files": "^2.3.9", "react-i18next": "^11.15.4", diff --git a/packages/fakeyou.com/src/components/common/Card/WeightsCards.tsx b/packages/fakeyou.com/src/components/common/Card/WeightsCards.tsx index e8879b68db..ee8ee9d52b 100644 --- a/packages/fakeyou.com/src/components/common/Card/WeightsCards.tsx +++ b/packages/fakeyou.com/src/components/common/Card/WeightsCards.tsx @@ -9,12 +9,14 @@ interface Props { } export default function WeightsCards({ props, type }: Props) { + console.log(props); switch (type) { case WeightCategory.TTS: case WeightCategory.VC: case WeightCategory.ZS: return ; case WeightCategory.SD: + case WeightCategory.WF: return ; default: return
Unsupported weight type
; diff --git a/packages/fakeyou.com/src/components/common/SelectionBubbles/SelectionBubbles.scss b/packages/fakeyou.com/src/components/common/SelectionBubbles/SelectionBubbles.scss index 689bc124af..309e3bffc1 100644 --- a/packages/fakeyou.com/src/components/common/SelectionBubbles/SelectionBubbles.scss +++ b/packages/fakeyou.com/src/components/common/SelectionBubbles/SelectionBubbles.scss @@ -7,11 +7,22 @@ .scroll-indicator { position: absolute; - z-index: 2; + z-index: 3; top: 50%; right: 0px; transform: translateY(-50%); - color: rgba($white, 0.2); + color: rgba($white, 0.3); + pointer-events: none; + transition: all 0.4s; + } + + .scroll-indicator-left { + position: absolute; + z-index: 3; + top: 50%; + left: 0px; + transform: translateY(-50%); + color: rgba($white, 0.3); pointer-events: none; transition: all 0.4s; } @@ -19,19 +30,37 @@ &:after { content: ""; position: absolute; + z-index: 2; top: 0; right: 0; bottom: 0; - width: 80px; + width: 60px; background: linear-gradient(to right, rgba($panel, 0), $panel); pointer-events: none; display: none; transition: all 0.4s; } + &:before { + content: ""; + position: absolute; + z-index: 2; + top: 0; + left: 0; + bottom: 0; + width: 60px; + background: linear-gradient(to left, rgba($panel, 0), $panel); + pointer-events: none; + display: none; + transition: all 0.4s; + } + &.show-gradient:after { display: block; - transition: all 0.4s; + } + + &.show-left-gradient:before { + display: block; } } diff --git a/packages/fakeyou.com/src/components/common/SelectionBubbles/SelectionBubbles.tsx b/packages/fakeyou.com/src/components/common/SelectionBubbles/SelectionBubbles.tsx index 356a04a4c3..32097e5a59 100644 --- a/packages/fakeyou.com/src/components/common/SelectionBubbles/SelectionBubbles.tsx +++ b/packages/fakeyou.com/src/components/common/SelectionBubbles/SelectionBubbles.tsx @@ -1,7 +1,10 @@ import React, { useEffect, useRef, useState } from "react"; import "./SelectionBubbles.scss"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; -import { faChevronRight } from "@fortawesome/pro-solid-svg-icons"; +import { + faChevronLeft, + faChevronRight, +} from "@fortawesome/pro-solid-svg-icons"; interface SelectionBubbleProps { options: string[]; @@ -17,6 +20,7 @@ export default function SelectionBubbles({ options.length > 0 ? options[0] : null ); const [showGradient, setShowGradient] = useState(true); + const [showLeftGradient, setShowLeftGradient] = useState(false); const bubblesRef = useRef(null); const handleSelect = ( @@ -38,40 +42,43 @@ export default function SelectionBubbles({ const handleScroll = () => { if (bubblesRef.current) { const { scrollLeft, scrollWidth, clientWidth } = bubblesRef.current; - const isAtEnd = scrollWidth - Math.round(scrollLeft + clientWidth) <= 1; // Adjust tolerance as needed + const isAtEnd = scrollWidth - Math.round(scrollLeft + clientWidth) <= 1; + const isAtStart = scrollLeft <= 1; setShowGradient(!isAtEnd); + setShowLeftGradient(!isAtStart); } }; - const checkForOverflowContent = () => { - if (bubblesRef.current) { - const { scrollWidth, clientWidth } = bubblesRef.current; - const isOverflowing = scrollWidth > clientWidth; - setShowGradient(isOverflowing); - } - }; - - useEffect(() => { - checkForOverflowContent(); - window.addEventListener("resize", checkForOverflowContent); - return () => window.removeEventListener("resize", checkForOverflowContent); - }, [options]); - useEffect(() => { if (bubblesRef.current) { bubblesRef.current.addEventListener("scroll", handleScroll); + handleScroll(); return () => // eslint-disable-next-line react-hooks/exhaustive-deps bubblesRef.current?.removeEventListener("scroll", handleScroll); } + }, [options]); + + useEffect(() => { + const handleResize = () => { + handleScroll(); + }; + window.addEventListener("resize", handleResize); + return () => window.removeEventListener("resize", handleResize); }, []); return (
+ {showLeftGradient && ( + + )}
{options.map(option => (
diff --git a/packages/fakeyou.com/src/v2/view/pages/landing/fakeyou/FakeYouLandingHeader.tsx b/packages/fakeyou.com/src/v2/view/pages/landing/fakeyou/FakeYouLandingHeader.tsx index 764e252e87..f278e5de56 100644 --- a/packages/fakeyou.com/src/v2/view/pages/landing/fakeyou/FakeYouLandingHeader.tsx +++ b/packages/fakeyou.com/src/v2/view/pages/landing/fakeyou/FakeYouLandingHeader.tsx @@ -50,7 +50,7 @@ export default function FakeYouLandingHeader({ /> -
+
diff --git a/packages/fakeyou.com/src/v2/view/pages/media/MediaPage.tsx b/packages/fakeyou.com/src/v2/view/pages/media/MediaPage.tsx index 0a20e94b42..c041caf518 100644 --- a/packages/fakeyou.com/src/v2/view/pages/media/MediaPage.tsx +++ b/packages/fakeyou.com/src/v2/view/pages/media/MediaPage.tsx @@ -265,6 +265,7 @@ export default function MediaPage() { [WeightCategory.SD]: { weightCategory: "Image Generation" }, [WeightCategory.ZS]: { weightCategory: "Voice Designer" }, [WeightCategory.VOCODER]: { weightCategory: "Vocoder" }, + [WeightCategory.WF]: { weightCategory: "Workflow Config" }, }; let weightCategory = "none"; diff --git a/packages/fakeyou.com/src/v2/view/pages/upload/UploadWorkflowPage.tsx b/packages/fakeyou.com/src/v2/view/pages/upload/UploadWorkflowPage.tsx new file mode 100644 index 0000000000..354e928033 --- /dev/null +++ b/packages/fakeyou.com/src/v2/view/pages/upload/UploadWorkflowPage.tsx @@ -0,0 +1,163 @@ +import React from "react"; +import { + faCircleExclamation, + faEye, + faArrowsTurnToDots +} from "@fortawesome/free-solid-svg-icons"; +import { usePrefixedDocumentTitle } from "common/UsePrefixedDocumentTitle"; +import PageHeader from "components/layout/PageHeader"; +import { + Button, + Container, + SplitPanel, + TempInput, + TempSelect, + TempTextArea, +} from "components/common"; +import { FrontendInferenceJobType } from "@storyteller/components/src/jobs/InferenceJob"; +import InferenceJobsList from "components/layout/InferenceJobsList"; +import { SessionWrapper } from "@storyteller/components/src/session/SessionWrapper"; +import useWorkflowUpload from "hooks/useWorkflowUpload"; + +interface UploadWorkflowPageProps { + sessionWrapper: SessionWrapper; +} + +export default function UploadWorkflowPage({ + sessionWrapper, +}: UploadWorkflowPageProps) { + usePrefixedDocumentTitle("Edit Voice"); + + const visibilityOptions = [ + { label: "Public", value: "public" }, + { label: "Private", value: "private" }, + ]; + + + const failures = (fail = "") => { + switch (fail) { + default: + return "Uknown failure"; + } + }; + + const { + //state values + uploadPath, + title, + description, + commitHash, + visibility, + // callback functions + onChange, + upload, + } = useWorkflowUpload(); + + if (!sessionWrapper.isLoggedIn()) { + return ( + + +
+ } + /> + + ); + } + + return ( + + + + + + +
+
+ + + + + + + +
+
+
+ +
+
+
+
+
+ ); +} diff --git a/packages/fakeyou.com/src/v2/view/pages/weight/WeightPage.tsx b/packages/fakeyou.com/src/v2/view/pages/weight/WeightPage.tsx index 11e051d2c3..667c9a7a63 100644 --- a/packages/fakeyou.com/src/v2/view/pages/weight/WeightPage.tsx +++ b/packages/fakeyou.com/src/v2/view/pages/weight/WeightPage.tsx @@ -73,13 +73,7 @@ export default function WeightPage({ const history = useHistory(); const bookmarks = useBookmarks(); const ratings = useRatings(); - const { - data: weight, - fetchError, - isLoading, - title, - remove, - } = useWeightFetch({ + const fetchedWeight = useWeightFetch({ onRemove: () => { history.push(source || ""); }, @@ -89,7 +83,14 @@ export default function WeightPage({ }, token: weight_token, }); - + const { + data: weight, + fetchError, + isLoading, + title, + remove, + } = fetchedWeight; + console.log(fetchedWeight); const timeUpdated = moment(weight?.updated_at || "").fromNow(); const dateUpdated = moment(weight?.updated_at || "").format("LLL"); const dateCreated = moment(weight?.created_at || "").format("LLL"); @@ -287,6 +288,7 @@ export default function WeightPage({ [WeightCategory.SD]: { weightCategory: "Image Generation" }, [WeightCategory.ZS]: { weightCategory: "Voice Designer" }, [WeightCategory.VOCODER]: { weightCategory: "Vocoder" }, + [WeightCategory.WF]: { weightCategory: "Workflow Config" }, }; let { weightCategory } = weightCategoryMap[weight.weight_category] || { @@ -321,14 +323,11 @@ export default function WeightPage({ switch (weight.weight_category) { case WeightCategory.TTS: - weightDetails = ; - break; case WeightCategory.VC: - weightDetails = ; - break; case WeightCategory.ZS: weightDetails = ; break; + case WeightCategory.WF: case WeightCategory.SD: weightDetails = ; break; diff --git a/yarn.lock b/yarn.lock index b43b132b6e..a52fcd9b8b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4468,6 +4468,7 @@ __metadata: react: ^16.13.1 react-audio-voice-recorder: ^1.0.5 react-autocomplete: ^1.8.1 + react-device-detect: ^2.2.3 react-dom: ^16.13.1 react-drag-drop-files: ^2.3.9 react-i18next: ^11.15.4 @@ -17772,6 +17773,18 @@ __metadata: languageName: node linkType: hard +"react-device-detect@npm:^2.2.3": + version: 2.2.3 + resolution: "react-device-detect@npm:2.2.3" + dependencies: + ua-parser-js: ^1.0.33 + peerDependencies: + react: ">= 0.14.0" + react-dom: ">= 0.14.0" + checksum: 42d9b3182b9d2495bf0d7914c9f370da51d8bdb853a3eba2acaf433894ae760386a075ba103185be825b33d42f50d85ef462087f261656d433f4c74dab23861f + languageName: node + linkType: hard + "react-dom@npm:^16.13.1": version: 16.14.0 resolution: "react-dom@npm:16.14.0" @@ -20934,6 +20947,13 @@ __metadata: languageName: node linkType: hard +"ua-parser-js@npm:^1.0.33": + version: 1.0.37 + resolution: "ua-parser-js@npm:1.0.37" + checksum: 4d481c720d523366d7762dc8a46a1b58967d979aacf786f9ceceb1cd767de069f64a4bdffb63956294f1c0696eb465ddb950f28ba90571709e33521b4bd75e07 + languageName: node + linkType: hard + "uglify-js@npm:^3.1.4": version: 3.15.0 resolution: "uglify-js@npm:3.15.0"