Skip to content

Commit

Permalink
small fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jbilcke-hf committed Aug 27, 2024
1 parent b67cf31 commit 128a1a6
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 6 deletions.
2 changes: 1 addition & 1 deletion packages/app/src/app/api/resolve/providers/falai/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ export async function resolveSegment(
model = request.settings.videoGenerationWorkflow.data || ''

// console.log(`request.settings.falAiModelForVideo = `, request.settings.falAiModelForVideo)
if (model === 'fal-ai/live-portrait') {
if (model === 'fal-ai/live-portrait' && request.prompts.video.image) {
const result = (await fal.run(model, {
input: {
image_url: request.prompts.video.image,
Expand Down
13 changes: 10 additions & 3 deletions packages/app/src/app/api/resolve/providers/replicate/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ export async function resolveSegment(

if (
request.settings.imageGenerationWorkflow.data === 'fofr/pulid-lightning'
&& request.prompts.image.identity
) {
params = {
...params,
Expand Down Expand Up @@ -71,7 +72,8 @@ export async function resolveSegment(
!request.settings.censorNotForAllAudiencesContent,
}
} else if (
request.settings.imageGenerationWorkflow.data === 'zsxkib/pulid'
request.settings.imageGenerationWorkflow.data === 'zsxkib/pulid'
&& request.prompts.image.identity
) {
params = {
...params,
Expand All @@ -86,6 +88,8 @@ export async function resolveSegment(

segment.assetUrl = `${response[0] || ''}`
} else if (request.segment.category === ClapSegmentCategory.DIALOGUE) {

if (request.prompts.voice.positive && request.prompts.voice.identity) {
const response = (await replicate.run(
request.settings.voiceGenerationWorkflow.data as any,
{
Expand All @@ -98,10 +102,13 @@ export async function resolveSegment(
}
)) as any
segment.assetUrl = `${response[0] || ''}`
} else {
console.log(`cannot generate a dialogue without a voice identity`)
}
} else if (request.segment.category === ClapSegmentCategory.VIDEO) {
const model = request.settings.videoGenerationWorkflow.data as any

if (model.startsWith('fofr/live-portrait')) {
if (model.startsWith('fofr/live-portrait') && request.prompts.video.image) {
const response = (await replicate.run(
request.settings.videoGenerationWorkflow.data as any,
{
Expand Down Expand Up @@ -146,7 +153,7 @@ export async function resolveSegment(
}
)) as any
segment.assetUrl = `${response[0] || ''}`
} else {
} else if (request.prompts.video.image) {
const response = (await replicate.run(
request.settings.videoGenerationWorkflow.data as any,
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ export function VideoLipsyncWorkflows() {
return (
<MenubarSub>
<MenubarSubTrigger>
<Tag size="lg" color={TagColor.ZINC}>
lip&amp;sync
<Tag size="lg" color={TagColor.BLUE}>
video&nbsp;lipsync
</Tag>
<div className={cn(`flex flex-row items-center space-x-2`)}>
{workflow?.provider && (
Expand Down
2 changes: 2 additions & 0 deletions packages/app/src/components/toolbars/top-menu/video/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import { useResolver } from '@/services/resolver/useResolver'
import { IsBusy } from '../IsBusy'
import { VideoDepthWorkflows } from '../lists/VideoDepthWorkflows'
import { VideoSegmentationWorkflows } from '../lists/VideoSegmentationWorkflows'
import { VideoLipsyncWorkflows } from '../lists/VideoLipsyncWorkflows'

export function TopMenuVideo() {
const nbPendingRequestsForVideo = useResolver(
Expand Down Expand Up @@ -51,6 +52,7 @@ export function TopMenuVideo() {
</MenubarItem>
<MenubarSeparator />
<VideoGenerationWorkflows />
<VideoLipsyncWorkflows />
<VideoUpscalingWorkflows />
<VideoDepthWorkflows />
<VideoSegmentationWorkflows />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,20 @@ export const noneWorkflows: ClapWorkflow[] = [
inputFields: [],
inputValues: {},
},
{
id: 'none://video/lipsync',
label: 'No video lipsync',
description: '',
tags: [],
author: '',
thumbnailUrl: '',
nonCommercial: false,
engine: ClapWorkflowEngine.DEFAULT,
category: ClapWorkflowCategory.VIDEO_LIPSYNC,
provider: ClapWorkflowProvider.NONE,
data: '',
schema: '',
inputFields: [],
inputValues: {},
},
]

0 comments on commit 128a1a6

Please sign in to comment.