Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wip: ai model gallery #2316

Open
wants to merge 44 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
b253662
feat: redesign
0xcadams Aug 23, 2024
882fc9e
fix: package json
0xcadams Aug 23, 2024
5e91469
fix: undo prettier?
0xcadams Aug 23, 2024
c209d02
fix: button
0xcadams Aug 23, 2024
3d4d94f
fix: build
0xcadams Aug 23, 2024
33c2be1
fix: prettier
0xcadams Aug 23, 2024
274412c
Merge commit 'dd62fb0ce9f17022c10776121ba34389b6ab271e' into 0xcadams…
0xcadams Sep 17, 2024
982f40b
feat: add model gallery page
suhailkakar Sep 23, 2024
bfc10e0
add assets
suhailkakar Sep 23, 2024
63fb8bf
wip: playground page
suhailkakar Sep 23, 2024
37a1527
fix: vercel build error
suhailkakar Sep 23, 2024
a63a74c
feat: add custom model banner
suhailkakar Sep 24, 2024
e7b8ae5
wip: dynamic inputs
suhailkakar Sep 24, 2024
3ed1c00
wip: add i2i inputs
suhailkakar Sep 24, 2024
b6da5c5
update copy
suhailkakar Sep 27, 2024
9f6c3fd
add i2i and i2v inputs
suhailkakar Sep 29, 2024
f75be7f
update model Ids
suhailkakar Sep 29, 2024
c368260
finish the api integration
suhailkakar Sep 29, 2024
c4f36e4
feat: add t2i endpoint
suhailkakar Sep 29, 2024
75d7ff2
fix: href link on playground page
suhailkakar Sep 30, 2024
2dc659c
add request a model form
suhailkakar Sep 30, 2024
8a8ba69
ui: update colors and design
suhailkakar Oct 2, 2024
65639ec
ui: fix sidebar child indentation
suhailkakar Oct 2, 2024
e13562e
ui: update card element colors
suhailkakar Oct 2, 2024
1595da9
ui: fix more issues
suhailkakar Oct 2, 2024
10f51dd
Merge remote-tracking branch 'origin/0xcadams/redesign' into 0xcadams…
0xcadams Oct 2, 2024
73ae78c
Merge branch '0xcadams/redesign' of https://github.com/livepeer/studi…
suhailkakar Oct 7, 2024
53480ee
ui: minor ui update
suhailkakar Oct 7, 2024
c3662ff
add generation time component
suhailkakar Oct 7, 2024
493c037
fix reset button
suhailkakar Oct 7, 2024
43c7472
feat: add upscale endpoint
suhailkakar Oct 7, 2024
7a79feb
feat: add image to video endpoint
suhailkakar Oct 7, 2024
2fa26b7
feat: add image to image endpoint
suhailkakar Oct 7, 2024
9338e68
feat: integrate hubspot for request model form
suhailkakar Oct 7, 2024
b9e9d55
ci: fix build error
suhailkakar Oct 7, 2024
4565a42
feat: add audio to text pipeline
suhailkakar Oct 8, 2024
c1072ca
ui: minor ui update
suhailkakar Oct 8, 2024
9e698b2
feat: add ftux model
suhailkakar Oct 9, 2024
82788bd
feat: add sam 2 pipeline
suhailkakar Oct 9, 2024
2fcff91
finished sam 2 integration
suhailkakar Oct 9, 2024
f88d9b7
ui: update ftux model
suhailkakar Oct 9, 2024
b1924bc
ui: add download option
suhailkakar Oct 9, 2024
36cd50a
minor update
suhailkakar Oct 9, 2024
bd796d9
ui: add docs link button
suhailkakar Oct 9, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
148,049 changes: 148,049 additions & 0 deletions .yarn/releases/yarn-classic.cjs

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
yarnPath: .yarn/releases/yarn-classic.cjs
4 changes: 2 additions & 2 deletions packages/api/esbuild.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ async function getFiles(dir) {
dirents.map((dirent) => {
const res = resolve(dir, dirent.name);
return dirent.isDirectory() ? getFiles(res) : res;
}),
})
);
return Array.prototype.concat(...files).filter((f) => !f.includes("cache"));
}
Expand Down Expand Up @@ -46,7 +46,7 @@ let frontendBundlePlugin = {
loader: "js",
resolveDir: resolve(args.resolveDir, args.path),
};
},
}
);

// Any files from the static-build directory should be bundled as binary
Expand Down
2 changes: 1 addition & 1 deletion packages/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@
"prettier": "^2.6.2",
"redoc-cli": "^0.8.3",
"tus-js-client": "^3.0.0-0",
"typescript": "^4.3.4"
"typescript": "^5.5.4"
},
"homepage": "https://livepeer.org",
"repository": {
Expand Down
8 changes: 6 additions & 2 deletions packages/api/src/task/scheduler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,9 @@ export class TaskScheduler {
const task = await db.task.get(event.task.id, { useReplica: false });
if (!task || task?.deleted) {
console.log(
`task event process error: task ${event.task.id} ${task ? "is deleted" : "not found"} in process task event`,
`task event process error: task ${event.task.id} ${
task ? "is deleted" : "not found"
} in process task event`,
);
return true;
}
Expand Down Expand Up @@ -220,7 +222,9 @@ export class TaskScheduler {
const task = await db.task.get(event.task.id, { useReplica: false });
if (!task || task?.deleted) {
console.log(
`task event process error: task ${event.task.id} ${task ? "is deleted" : "not found"} in process task result partial`,
`task event process error: task ${event.task.id} ${
task ? "is deleted" : "not found"
} in process task result partial`,
);
return true;
}
Expand Down
96 changes: 41 additions & 55 deletions packages/www/components/ApiKeys/CreateDialog.tsx
Original file line number Diff line number Diff line change
@@ -1,24 +1,26 @@
import {
Box,
Button,
Flex,
AlertDialog,
AlertDialogContent,
AlertDialogTitle,
AlertDialogDescription,
AlertDialogCancel,
TextField,
Text,
Heading,
Label,
Link,
Tooltip,
Checkbox,
styled,
} from "@livepeer/design-system";
import { Button } from "components/ui/button";
import { useState, useEffect, useCallback, useMemo } from "react";
import { useApi } from "../../hooks";
import Spinner from "components/Spinner";
import {
Dialog,
DialogContent,
DialogTitle,
DialogDescription,
DialogClose,
} from "components/ui/dialog";
import { Text } from "components/ui/text";
import { ApiToken } from "@livepeer.studio/api";
import {
ExclamationTriangleIcon as Warning,
Expand All @@ -27,6 +29,7 @@ import {
PlusIcon as Plus,
} from "@radix-ui/react-icons";
import ClipButton from "../Clipping/ClipButton";
import { Input } from "components/ui/input";

const initialCorsOpts: ApiToken["access"]["cors"] = {
allowedOrigins: ["http://localhost:3000"],
Expand Down Expand Up @@ -115,13 +118,13 @@ const CreateDialog = ({
}, [toggleOrigin, setNewAllowedOrigin, isNewOriginValid]);

return (
<AlertDialog open={isOpen} onOpenChange={onOpenChange}>
<AlertDialogContent css={{ maxWidth: 450, px: "$5", pt: "$4", pb: "$4" }}>
<Dialog open={isOpen} onOpenChange={onOpenChange}>
<DialogContent css={{ maxWidth: 450, px: "$5", pt: "$4", pb: "$4" }}>
{!newToken && (
<>
<AlertDialogTitle asChild>
<DialogTitle>
<Heading size="1">Create an API Key</Heading>
</AlertDialogTitle>
</DialogTitle>
<Box
as="form"
onSubmit={async (e) => {
Expand All @@ -141,18 +144,14 @@ const CreateDialog = ({
setCreating(false);
}
}}>
<AlertDialogDescription asChild>
<Text
size="3"
variant="neutral"
css={{ mt: "$2", lineHeight: "22px", mb: "$2" }}>
<DialogDescription asChild>
<Text className="my-2" variant="neutral">
Enter a name for your key to differentiate it from other keys.
</Text>
</AlertDialogDescription>
</DialogDescription>

<Flex direction="column" gap="2">
<TextField
size="2"
<Input
type="text"
required
id="tokenName"
Expand Down Expand Up @@ -200,16 +199,10 @@ const CreateDialog = ({
Add an origin
</Label>
<Box css={{ display: "flex", alignItems: "stretch" }}>
<TextField
size="2"
<Input
type="text"
id="addAllowedOrigin"
value={newAllowedOrigin}
state={
newAllowedOrigin !== "" && !isNewOriginValid
? "invalid"
: null
}
onChange={(e) => setNewAllowedOrigin(e.target.value)}
onKeyDown={(e) => {
if (e.key === "Enter") {
Expand All @@ -220,9 +213,8 @@ const CreateDialog = ({
placeholder="e.g. * for all origins; https://example.com for one"
/>
<Button
css={{ ml: "$1" }}
size="3"
variant="primary"
className="ml-1"
variant="outline"
disabled={!isNewOriginValid}
onClick={(e) => {
e.preventDefault();
Expand All @@ -232,6 +224,10 @@ const CreateDialog = ({
</Button>
</Box>

{newAllowedOrigin !== "" && !isNewOriginValid ? (
<Text variant="error">Invalid origin</Text>
) : null}

<Flex
align="center"
direction="column"
Expand All @@ -244,26 +240,25 @@ const CreateDialog = ({
height: 120,
overflowX: "hidden",
overflowY: "auto",
border: "1px solid $colors$neutral7",
backgroundColor: "$neutral2",
backgroundColor: "hsl(var(--card))",
mt: "-3px",
zIndex: 1,
}}>
{cors.allowedOrigins.length > 0 ? (
cors.allowedOrigins.map((origin, i) => (
<Flex
key={i}
key={origin}
justify="between"
align="center"
css={{
width: "100%",
borderBottom: "1px solid $colors$neutral5",
p: "$2",
fontSize: "$2",
color: "$hiContrast",
}}>
{origin}
<StyledCross
className="h-3 w-3"
onClick={() => {
toggleOrigin(origin);
}}
Expand Down Expand Up @@ -323,16 +318,10 @@ const CreateDialog = ({
</Flex>

<Flex css={{ jc: "flex-end", gap: "$3", mt: "$4" }}>
<AlertDialogCancel asChild>
<Button size="2" ghost>
Cancel
</Button>
</AlertDialogCancel>
<Button
size="2"
disabled={creating}
type="submit"
variant="primary">
<DialogClose asChild>
<Button variant="outline">Cancel</Button>
</DialogClose>
<Button disabled={creating} type="submit">
{creating && (
<Spinner
css={{
Expand All @@ -351,31 +340,28 @@ const CreateDialog = ({
)}
{newToken && (
<Box>
<AlertDialogTitle asChild>
<DialogTitle>
<Heading size="1">Token Created</Heading>
</AlertDialogTitle>
<AlertDialogDescription asChild>
<Text
size="3"
variant="neutral"
css={{ mt: "$2", lineHeight: "22px", mb: "$2" }}>
</DialogTitle>
<DialogDescription asChild>
<Text className="my-2" variant="neutral">
<Box>
<Box css={{ mb: "$2" }}>Here's your new API key:</Box>
<Button variant="neutral" size="2">
<Button variant="outline">
<ClipButton value={newToken.id} text={newToken.id} />
</Button>
</Box>
</Text>
</AlertDialogDescription>
</DialogDescription>
<Flex css={{ jc: "flex-end", gap: "$3", mt: "$4" }}>
<Button onClick={() => onClose()} size="2">
<Button onClick={() => onClose()} variant="outline">
Close
</Button>
</Flex>
</Box>
)}
</AlertDialogContent>
</AlertDialog>
</DialogContent>
</Dialog>
);
};

Expand Down
7 changes: 5 additions & 2 deletions packages/www/components/ApiKeys/KeyCell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ import {
HoverCardTrigger,
Flex,
HoverCardContent,
Button,
Text,
useSnackbar,
} from "@livepeer/design-system";
import { CopyIcon } from "@radix-ui/react-icons";
import { useState } from "react";
import { CopyToClipboard } from "react-copy-to-clipboard";
import { Button } from "components/ui/button";

const KeyCell = ({ token }) => {
const [openSnackbar] = useSnackbar();
Expand Down Expand Up @@ -52,7 +52,10 @@ const KeyCell = ({ token }) => {
</HoverCardContent>
</HoverCardRoot>
) : (
<Button size="1" type="button" onClick={() => setKeyRevealed(true)}>
<Button
size="sm"
variant="outline"
onClick={() => setKeyRevealed(true)}>
Reveal key
</Button>
)}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
import { Box, Flex } from "@livepeer/design-system";
import { ChevronDownIcon } from "@radix-ui/react-icons";
import { Dispatch, SetStateAction } from "react";
import { Button } from "components/ui/button";
import {
Box,
Flex,
Button,
DropdownMenu,
DropdownMenuTrigger,
DropdownMenuContent,
DropdownMenuGroup,
DropdownMenuItem,
} from "@livepeer/design-system";
import { ChevronDownIcon } from "@radix-ui/react-icons";
import { Dispatch, SetStateAction } from "react";
DropdownMenuTrigger,
} from "components/ui/dropdown-menu";

export type AssetChildrenHeadingBoxProps = {
children: React.ReactNode;
Expand Down Expand Up @@ -77,9 +76,7 @@ const AssetChildrenHeadingBox = ({
<Box css={{ position: "relative", top: "-8px" }}>
<DropdownMenu>
<DropdownMenuTrigger asChild>
<Button
size="2"
css={{ display: "flex", ai: "center", mr: "$1" }}>
<Button variant="secondary" size="sm">
Actions
<Box as={ChevronDownIcon} css={{ ml: "$1" }} />
</Button>
Expand Down
5 changes: 3 additions & 2 deletions packages/www/components/AssetDetails/AssetOverviewTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import { useApi } from "hooks";
import Spinner from "../Spinner";
import moment from "moment";
import ClipButton from "../Clipping/ClipButton";
import { Card } from "components/ui/card";

const StyledIpfsIcon = styled(IpfsIcon, {
color: "$gray",
Expand Down Expand Up @@ -134,7 +135,7 @@ const AssetOverviewTab = ({
may also archive them using the following storage providers.
</Text>
</Box>
<Promo size="2" css={{ borderRadius: "$2" }}>
<Card className="p-4">
<Flex css={{ justifyContent: "space-between" }}>
<Flex align="center">
<StyledIpfsIcon />
Expand Down Expand Up @@ -206,7 +207,7 @@ const AssetOverviewTab = ({
</Flex>
</Box>
)}
</Promo>
</Card>
</Box>
</>
);
Expand Down
Loading
Loading