From 37a60f0fc52c8f3ec994984c4c464a4a133ee930 Mon Sep 17 00:00:00 2001 From: Daniel Rochetti Date: Tue, 10 Sep 2024 20:48:18 -0700 Subject: [PATCH] chore: update readme --- README.md | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index a216477..072ab2e 100644 --- a/README.md +++ b/README.md @@ -1,23 +1,23 @@ # The fal.ai Dart/Flutter client ![fal_client pub.dev package](https://img.shields.io/pub/v/fal_client?color=%237527D7&label=fal_client&style=flat-square) -![Build](https://img.shields.io/github/actions/workflow/status/fal-ai/serverless-client-dart/build.yml?style=flat-square) -![License](https://img.shields.io/github/license/fal-ai/serverless-client-dart?style=flat-square) +![Build](https://img.shields.io/github/actions/workflow/status/fal-ai/fal-dart/build.yml?style=flat-square) +![License](https://img.shields.io/github/license/fal-ai/fal-dart?style=flat-square) ## About the Project -The `fal_client` is a robust and user-friendly library designed for seamless integration of fal serverless functions in Dart and Flutter projects. Developed in pure Dart, it provides developers with simple APIs to interact with AI models and works across all supported Flutter platforms. +The `fal_client` is a robust and user-friendly library designed for seamless integration of fal model inference and training endpoints in Dart and Flutter projects. Developed in pure Dart, it provides developers with simple APIs to interact with AI models and works across all supported Flutter platforms. ## Getting Started -The `fal_client` library serves as a client for fal serverless Python functions. For guidance on creating your functions, refer to the [quickstart guide](https://fal.ai/docs). +The `fal_client` library serves as a client for fal APIs. For guidance on running out inference and training APIs, refer to the [quickstart guide](https://fal.ai/docs). ### Client Library This client library is crafted as a lightweight layer atop platform standards like `http` and `cross_file`. This ensures a hassle-free integration into your existing codebase. Moreover, it addresses platform disparities, guaranteeing flawless operation across various Flutter runtimes. > **Note:** -> Ensure you've reviewed the [fal-serverless getting started guide](https://fal.ai/docs) to acquire your credentials and register your functions. +> Ensure you've reviewed the [fal getting started guide](https://fal.ai/docs) to acquire your credentials and register your functions. 1. Start by adding `fal_client` as a dependency: @@ -30,36 +30,36 @@ This client library is crafted as a lightweight layer atop platform standards li ```dart import 'package:fal_client/fal_client.dart'; - final fal = FalClient.withCredentials('FAL_KEY_ID:FAL_KEY_SECRET'); + final fal = FalClient.withCredentials('FAL_KEY'); ``` -3. Now use `fal.subcribe` to dispatch requests to the model API: +3. Now use `fal.subscribe` to dispatch requests to the model API: ```dart - final result = await fal.subscribe('text-to-image', + final output = await fal.subscribe('fal-ai/flux/dev', input: { - 'prompt': 'a cute shih-tzu puppy', - 'model_name': 'stabilityai/stable-diffusion-xl-base-1.0', - 'image_size': 'square_hd' + 'prompt': 'a cute shih-tzu puppy' }, onQueueUpdate: (update) => {print(update)} ); + print(output.data); + print(output.requestId); ``` **Notes:** -- Replace `text-to-image` with a valid model id. Check [fal.ai/models](https://fal.ai/models) for all available models. -- The result type is a `Map` and the entries depend on the API output schema. +- Replace `fal-ai/flux/dev` with the model of your preference. Check [fal.ai/models](https://fal.ai/models) for all available models. +- The result type is a `FalOutput.data` and the entries depend on the API output schema. ## Roadmap -See the [open feature requests](https://github.com/fal-ai/serverless-client-dart/labels/enhancement) for a list of proposed features and join the discussion. +See the [open feature requests](https://github.com/fal-ai/fal-dart/labels/enhancement) for a list of proposed features and join the discussion. ## Contributing Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are **greatly appreciated**. -1. Make sure you read our [Code of Conduct](https://github.com/fal-ai/serverless-client-dart/blob/main/CODE_OF_CONDUCT.md) +1. Make sure you read our [Code of Conduct](https://github.com/fal-ai/fal-dart/blob/main/CODE_OF_CONDUCT.md) 2. Fork the project and clone your fork 3. Setup the local environment with `npm install` 4. Create a feature branch (`git checkout -b feature/add-cool-thing`) or a bugfix branch (`git checkout -b fix/smash-that-bug`) @@ -67,8 +67,8 @@ Contributions are what make the open source community such an amazing place to b 6. Push to the branch (`git push --set-upstream origin feature/add-cool-thing`) 7. Open a Pull Request -Check the [good first issue queue](https://github.com/fal-ai/serverless-client-dart/labels/good+first+issue), your contribution will be welcome! +Check the [good first issue queue](https://github.com/fal-ai/fal-dart/labels/good+first+issue), your contribution will be welcome! ## License -Distributed under the MIT License. See [LICENSE](https://github.com/fal-ai/serverless-client-dart/blob/main/LICENSE) for more information. +Distributed under the MIT License. See [LICENSE](https://github.com/fal-ai/fal-dart/blob/main/LICENSE) for more information.