Browse Source

Add 'replicate部署.md'

天问 1 year ago
parent
commit
dc80381478
1 changed files with 34 additions and 0 deletions
  1. 34 0
      replicate部署.md

+ 34 - 0
replicate部署.md

@@ -0,0 +1,34 @@
+
+## github托管项目
+
+## 训练模型
+
+
+## 调用api
+
+```
+
+
+npm install replicate
+
+export REPLICATE_API_TOKEN=<paste-your-token-here>
+
+
+import Replicate from "replicate";
+
+const replicate = new Replicate({
+  auth: process.env.REPLICATE_API_TOKEN,
+});
+
+const model = "stability-ai/stable-diffusion:db21e45d3f7023abc2a46ee38a23973f6dce16bb082a930b0c49861f96d1e5bf";
+const input = { prompt: "an astronaut riding a horse on mars, hd, dramatic lighting, detailed" };
+const output = await replicate.run(model, { input });
+
+console.log(output);
+
+
+
+node index.js
+```
+
+## Vercel 部署前端 WebUI