Skip to content

S1D1T1/PromptReaderClient

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

PromptReaderClient

A lightweight Swift class for integrating PromptReader into your macOS application. PromptReader is a floating inspector window that displays AI image generation parameters. This client class makes it easy to send images to PromptReader for inspection.

Basic Usage

First of all, you don't need to do anything to have PromptReader run alongside your image app. Users can drag images from your app to PromptReader to get extra info.
If you would like PromptReader to track the selection in your gallery or browser app, then read on. PromptReader can float above and display detailed info on the currently selected image. To have PR track the current selection, pass its URL to the PromptReaderClient object

// Initialize the client
let promptReader = PromptReaderClient()

// Display a file in PromptReader
func selectionDidChange(_ url: URL) {
    promptReader.inspect(url)
}

Screenshot

Features

  • Simple API for displaying files in PromptReader
  • Automatic checks for App availability
  • User preference management
  • SwiftUI support

Installation

Add PromptReaderClient.swift to your Xcode project. That's all.

SwiftUI Integration

We suggest adding a user preference toggle for enabling PR:

@AppStorage("callPromptReader") var callPromptReader = promptReader.isAppInstalled

Toggle("Show Image Settings in PromptReader", isOn: $callPromptReader)
    .disabled(!promptReader.isAppInstalled) // only enable the pref if app is installed
    .help(promptReader.isAppInstalled ?
          "Show full image settings using companion app, PromptReader" :
          "PromptReader is not installed")

Requirements

  • macOS 14 or later
  • PromptReader, Download

License

MIT License. See LICENSE file for details.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

About

Interface code for calling PromptReader

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages