Skip to content

Commit 6042726

Browse files
authored
better controlnet example (#104)
* better controlnet example * rm
1 parent f886e6d commit 6042726

File tree

1 file changed

+3
-14
lines changed

1 file changed

+3
-14
lines changed

examples/logo-controlnet.ts

+3-14
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,18 @@
11
#!/usr/bin/env -S npx ts-node --transpileOnly
22

3-
import {
4-
Substrate,
5-
StableDiffusionXLControlNet,
6-
RemoveBackground,
7-
} from "substrate";
3+
import { Substrate, StableDiffusionXLControlNet } from "substrate";
84

95
async function main() {
106
const substrate = new Substrate({ apiKey: process.env["SUBSTRATE_API_KEY"] });
11-
const image_uri =
12-
"https://substackcdn.com/image/fetch/w_500,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fsubstack.png";
13-
const mask = new RemoveBackground({
14-
image_uri,
15-
return_mask: true,
16-
store: "hosted",
17-
});
7+
const image_uri = "https://media.substrate.run/logo-nopad-bg-white.png";
188
const controlnet = new StableDiffusionXLControlNet({
199
prompt: "sunlit bright birds-eye view of the ocean, turbulent choppy waves",
20-
image_uri: mask.future.image_uri,
10+
image_uri: image_uri,
2111
control_method: "illusion",
2212
num_images: 4,
2313
store: "hosted",
2414
conditioning_scale: 1,
2515
});
26-
2716
const res = await substrate.run(controlnet);
2817
console.log(res.get(controlnet));
2918
}

0 commit comments

Comments
 (0)