jakiestfu / stability-ts

DreamStudio Client written in TypeScript
156 stars 33 forks source link

Sample code doesn't seem to work #13

Open vpzomtrrfrt opened 1 year ago

vpzomtrrfrt commented 1 year ago

Using the sample code from the README returns an error:

Generating Complete {
  isOk: false,
  status: 'InvalidArgument',
  code: 3,
  message: 'Must provide image parameters.',
...
vpzomtrrfrt commented 1 year ago

I can't get the CLI example to work either, did the API change?

vpzomtrrfrt commented 1 year ago

seems to work if I remove the code that adds classifier parameters

Probably related to this change to the protobufs: https://github.com/Stability-AI/api-interfaces/commit/d1c74bcb4fcbd1c7bf66471a73fb1d3900bd3005

vpzomtrrfrt commented 1 year ago

Possibly better workaround, pinning the version of api-interfaces:

diff --git a/package.json b/package.json
index a3cde84..3fde94c 100644
--- a/package.json
+++ b/package.json
@@ -43,7 +43,7 @@
     "process": "^0.11.10",
     "rimraf": "^3.0.2",
     "source-map-loader": "^4.0.0",
-    "stability-sdk": "Stability-AI/api-interfaces",
+    "stability-sdk": "Stability-AI/api-interfaces#1363356",
     "ts-loader": "^9.3.1",
     "typescript": "^4.8.2",
     "webpack": "^5.74.0",
altryne commented 1 year ago

@jakiestfu any chance to publish this fix to NPM soon?

Abel1011 commented 1 year ago

Possibly better workaround, pinning the version of api-interfaces:

diff --git a/package.json b/package.json
index a3cde84..3fde94c 100644
--- a/package.json
+++ b/package.json
@@ -43,7 +43,7 @@
     "process": "^0.11.10",
     "rimraf": "^3.0.2",
     "source-map-loader": "^4.0.0",
-    "stability-sdk": "Stability-AI/api-interfaces",
+    "stability-sdk": "Stability-AI/api-interfaces#1363356",
     "ts-loader": "^9.3.1",
     "typescript": "^4.8.2",
     "webpack": "^5.74.0",

I made the change in the package.json, but I still get the same message. Any recommendation (I'm using Next.js)

vpzomtrrfrt commented 1 year ago

To clarify, you would need to modify the package.json for this module and then somehow include the modified version in your larger project. I had trouble getting that to work without publishing to npm, so my fork is published as https://www.npmjs.com/package/stability-client with this and a few other improvements

drainmond commented 1 year ago

Thank you @vpzomtrrfrt, your fork is awesome!