|
@@ -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
|