Comments (8)
This would also be useful to set up an alert system when paying for things on a large scale to ensure the app doesn't become unusable during a massive surge in traffic and so I don't have to keep checking manually.
from stability-sdk.
With a recent update, API keys now have read-only access to certain dashboard operations, such as GetMe and GetOrganization, so this is now possible.
from stability-sdk.
@jessekoska We'll need to do some back-end work to support this, as API keys have a very limited permission set at the moment. Allowing API key permissions to be customized at creation time is on our radar.
from stability-sdk.
yeah i attempted this approach too (but must have not done something correct in the metadata approach cause i didn't get it to connect) but i also noticed that my account's Bearer token changed at some point so i stopped trying as i wasn't confident of how long the token would be valid or how i might refresh it
from stability-sdk.
coming soon, but hasn't been incorporated into this package yet. If you don't mind getting under the hood the grpc stubs you'll need can be found here:
- https://github.com/Stability-AI/api-interfaces/blob/main/gooseai/dashboard/dashboard_pb2.py
- https://github.com/Stability-AI/api-interfaces/blob/main/gooseai/dashboard/dashboard_pb2_grpc.py
from stability-sdk.
@dmarx I've managed to use the dashboard stub to access GetMe and I'm getting a permission error... is this something that i can get opened up? if so how?
grpc._channel._InactiveRpcError: <_InactiveRpcError of RPC that terminated with:
status = StatusCode.PERMISSION_DENIED
details = "You do not have permission to access this resource."
debug_error_string = "UNKNOWN:Error received from peer ipv4:104.18.21.212:443 {grpc_message:"You do not have permission to access this resource.", grpc_status:7, created_time:"2022-10-06T00:52:45.118895296+00:00"}"
I'm using the same StabilityInference example in client.py to open up the channel. generation works fine with the api token i'm using.
wd = pathlib.Path(file).parent.resolve()
dashPath = wd / "stability-sdk/api-interfaces/gooseai/dashboard"
sys.path.append(str(dashPath))
import dashboard_pb2 as dashboard
import dashboard_pb2_grpc as dashboard_grpc
#then inside class StabilityInference:
def get_me(self):
er = dashboard.EmptyRequest()
stub = dashboard_grpc.DashboardServiceStub(self.channel)
return stub.GetClientSettings(er, **self.grpc_args)
from stability-sdk.
As same to @CEOSiyris is saying, I also would like to monitor the remaining balance to use DreamStudio API in production.
But I've not figured out how to get the access token in a canonical way. Could you have some advice?
- I've opened https://beta.dreamstudio.ai/membership in the chrome browser and logged in to it
- Copied access token by inspecting "authorization: Bearer ..." request header using the chrome dev tool
- Set this token to call credential, built the stub of Dashboard service, and then I could call GetMe and GetOrganization successfully
- I could get OrganizationPaymentInfo.balance which seemed to be what I needed
It worked, but copying the token by the dev tool doesn't seem like the right way to do it.
from stability-sdk.
There's a handy function for this the animation notebook uses to fetch the user's profile picture and credit balance you could use: https://github.com/Stability-AI/stability-sdk/blob/main/src/stability_sdk/api.py#L181
It will probably shift locations as StabilityInference and api.Context merge up but that's one way to get it at the moment.
from stability-sdk.
Related Issues (20)
- Does not display the generated image filenames anymore (ARTIFACT_IMAGE)
- A problem with the name for some reason HOT 1
- The animation almost finishes but pauses on the last frame of the UI HOT 2
- Client default engines in environment HOT 1
- Clip Guidance Not working on the API HOT 2
- Error when running pip install in SageMaker notebook HOT 2
- T2IAdapterParameters not present in generaion_pb2 HOT 9
- Masked pixels get altered when using SDXL-0.9 HOT 9
- Unable to generate multiple images in single API call with distinct seeds
- REST api giving wrong data HOT 6
- animation API errors HOT 7
- ModuleNotFoundError: No module named 'keyframed' HOT 3
- The specified engine (ID stable-diffusion-v1-5) was not found.
- No Prompt with input image allowed?
- Api call returning error when different images are used
- "The specified engine (ID stable-inpainting-512-v2-0) was not found." HOT 1
- Prompt scheduling using sdk?
- stable-diffusion-xl-1024-v1-0 turns grey (100% noise)
- Unable install grpcio 1.53.0 HOT 1
- Error cases in gRPC
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from stability-sdk.