Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lhuanyu/GPTMessage
A SwiftUI app demonstrating how ChatGPT interacts with DALL·E and HuggingFace models for iOS and macOS.
https://github.com/lhuanyu/GPTMessage
aigc chatgpt chatgpt-app dall-e huggingface imagecaption imagegeneration imagetotext ios macos openai openai-api stable-diffusion swift swiftui texttoimage
Last synced: 2 months ago
JSON representation
A SwiftUI app demonstrating how ChatGPT interacts with DALL·E and HuggingFace models for iOS and macOS.
- Host: GitHub
- URL: https://github.com/lhuanyu/GPTMessage
- Owner: lhuanyu
- License: mit
- Created: 2023-03-27T15:13:47.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-06-15T12:32:10.000Z (over 1 year ago)
- Last Synced: 2024-08-07T23:47:50.664Z (6 months ago)
- Topics: aigc, chatgpt, chatgpt-app, dall-e, huggingface, imagecaption, imagegeneration, imagetotext, ios, macos, openai, openai-api, stable-diffusion, swift, swiftui, texttoimage
- Language: Swift
- Homepage:
- Size: 10.1 MB
- Stars: 47
- Watchers: 1
- Forks: 7
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# GPTMessage
A SwiftUI app demonstrating how ChatGPT interacts with DALL·E and HuggingFace models for iOS and macOS.This is what the app looks like on iOS:
And macOS:
## Feautures
### Chat CompletionChat Completion is driven by OpenAI's chat language models, including gpt-3.5-turbo and gpt-3.5-turbo-0301.
### Image GenerationImage Generation uses OpenAI's image generation API(DALL·E) and HuggingFace's Inference API to create images.
To start drawing, simply send a message beginning with "Draw". For example, you could say `Draw a close-up, studio photographic portrait of a curious-looking blue British Shorthair cat`.
`Draw something` is a hardcoded prompt. However, when Smart Mode is enabled, ChatGPT will classify your prompt and select the most appropriate model to handle it. Therefore, you could ask, `Can you assist me in creating a close-up, studio photographic portrait of a curious-looking blue British Shorthair cat?`.
OpenAI's DALL·E is the preferred option since it's stable and fast(but expensive). You can easily switch to Hugging Face's Inference API(like [stable-diffusion-v1-5](https://huggingface.co/runwayml/stable-diffusion-v1-5) or [stabilityai/stable-diffusion-2-1](https://huggingface.co/stabilityai/stable-diffusion-2-1)) in the settings.
### Image Caption
By connecting ChatGPT with an Image Caption model such as [nlpconnect/vit-gpt2-image-captioning](https://huggingface.co/nlpconnect/vit-gpt2-image-captioning) from Hugging Face, we can easily integrate the image captioning task with the image generation task.
## Prompts
Default prompts come from **[Awesome ChatGPT Prompts](https://github.com/f/awesome-chatgpt-prompts)**.
### iOS
Click the person icon or type '/' to show the prompts list.
### macOS
Type '/' to show the prompts list.
## Usage
Set your OpenAI API key in the `AppConfiguration`.
```swift
class AppConfiguration: ObservableObject {
@AppStorage("configuration.key") var key = "OpenAI API Key"
}
```Set your Hugging Face User Access Token in the `HuggingFaceConfiguration`.
```swift
class HuggingFaceConfiguration: ObservableObject {
@AppStorage("huggingFace.key") var key: String = ""
}
```