Skip to content

Commit c871531

Browse files
committed
Update CLI to remove LICENSE when creating new project & add more model options
1 parent ffaa425 commit c871531

File tree

4 files changed

+27
-5
lines changed

4 files changed

+27
-5
lines changed

npm-packages/cli/source/components/commands/create.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,12 @@ export default function Create({cli}: {cli: Result<Flags>}) {
9595
fs.rmSync(githubDirPath, {recursive: true, force: true});
9696
}
9797

98+
// Remove LICENSE file
99+
const licenseFilePath = path.join(process.cwd(), name, 'LICENSE');
100+
if (fs.existsSync(licenseFilePath)) {
101+
fs.rmSync(licenseFilePath, {force: true});
102+
}
103+
98104
setMessage(
99105
<Box>
100106
<Spinner type="dots" />

web/lib/modalities/image-gen/image-gen.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,11 @@ export function getImageGenModel(
145145
console.log({ prediction: prediction });
146146
}
147147

148-
const imgUrl = prediction.output[prediction.output.length - 1];
148+
// Get the last output if output is an array, else if it is string get the output directly
149+
const imgUrl =
150+
typeof prediction.output === "string"
151+
? prediction.output
152+
: prediction.output[prediction.output.length - 1];
149153

150154
const arrayBuffer = await fetch(imgUrl).then((res) => res.arrayBuffer());
151155

web/lib/modalities/image-gen/options.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,14 @@ export const imageGenProviderOptions: {
1313
model: "black-forest-labs/flux-schnell",
1414
isSupported: true,
1515
},
16+
{
17+
model: "black-forest-labs/flux-1.1-pro",
18+
isSupported: true,
19+
},
20+
{
21+
model: "black-forest-labs/flux-1.1-pro-ultra",
22+
isSupported: true,
23+
},
1624
],
1725
},
1826
};

web/lib/modalities/video-gen/video-gen.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -174,14 +174,18 @@ export function getVideoGenModel(
174174
console.log({ prediction: prediction });
175175
}
176176

177-
const imgUrl = prediction.output;
177+
const videoUrl =
178+
typeof prediction.output === "string"
179+
? prediction.output
180+
: prediction.output[prediction.output.length - 1];
178181

179-
console.log("Video URL:", imgUrl);
180182

181-
const arrayBuffer = await fetch(imgUrl).then((res) => res.arrayBuffer());
183+
console.log("Video URL:", videoUrl);
184+
185+
const arrayBuffer = await fetch(videoUrl).then((res) => res.arrayBuffer());
182186

183187
return {
184-
url: imgUrl,
188+
url: videoUrl,
185189
arrayBuffer: arrayBuffer,
186190
};
187191
}

0 commit comments

Comments
 (0)