|
@@ -31,4 +31,32 @@ console.log(output);
|
|
|
node index.js
|
|
|
```
|
|
|
|
|
|
+
|
|
|
+```
|
|
|
+
|
|
|
+pip install replicate
|
|
|
+
|
|
|
+export REPLICATE_API_TOKEN=<paste-your-token-here>
|
|
|
+
|
|
|
+
|
|
|
+import replicate
|
|
|
+replicate.run(
|
|
|
+ "stability-ai/stable-diffusion:27b93a2413e7f36cd83da926f3656280b2931564ff050bf9575f1fdf9bcd7478",
|
|
|
+ input={"prompt": "a 19th century portrait of a wombat gentleman"}
|
|
|
+)
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+image = open("mystery.jpg", "rb")
|
|
|
+# or...
|
|
|
+image = "https://example.com/mystery.jpg"
|
|
|
+
|
|
|
+replicate.run(
|
|
|
+ "replicate/resnet:dd782a3d531b61af491d1026434392e8afb40bfb53b8af35f727e80661489767",
|
|
|
+ input={"image": image}
|
|
|
+)
|
|
|
+
|
|
|
+
|
|
|
+```
|
|
|
+
|
|
|
## Vercel 部署前端 WebUI
|