Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: aiGeneratedUser/openai-async-image-swiftui
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: main
Choose a base ref
...
head repository: swiftuiux/openai-async-image-swiftui
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
Able to merge. These branches can be automatically merged.

Commits on Jul 3, 2024

  1. Update .DS_Store

    swiftuiux committed Jul 3, 2024
    Copy the full SHA
    ba47dfc View commit details
  2. Copy the full SHA
    af553e5 View commit details
  3. Update README.md

    swiftuiux committed Jul 3, 2024
    Copy the full SHA
    eb1a284 View commit details

Commits on Jul 4, 2024

  1. Copy the full SHA
    328d126 View commit details
  2. Copy the full SHA
    86f6523 View commit details
  3. update

    swiftuiux committed Jul 4, 2024
    Copy the full SHA
    bb4c3e0 View commit details
  4. updated loader

    swiftuiux committed Jul 4, 2024
    Copy the full SHA
    cb5658d View commit details

Commits on Jul 7, 2024

  1. refactor error handling

    swiftuiux committed Jul 7, 2024
    Copy the full SHA
    a33a0db View commit details
  2. Copy the full SHA
    cbe62bc View commit details

Commits on Jul 24, 2024

  1. update

    swiftuiux committed Jul 24, 2024
    Copy the full SHA
    a8bf018 View commit details

Commits on Jul 25, 2024

  1. update

    swiftuiux committed Jul 25, 2024
    Copy the full SHA
    323062b View commit details

Commits on Jul 26, 2024

  1. update

    swiftuiux committed Jul 26, 2024
    Copy the full SHA
    9b02d7e View commit details

Commits on Aug 21, 2024

  1. Update README.md

    swiftuiux committed Aug 21, 2024
    Copy the full SHA
    aeda731 View commit details

Commits on Sep 14, 2024

  1. Create .spi.yml

    swiftuiux authored Sep 14, 2024
    Copy the full SHA
    d42caed View commit details
  2. Update .spi.yml

    swiftuiux authored Sep 14, 2024
    Copy the full SHA
    768e1ad View commit details

Commits on Sep 20, 2024

  1. Update README.md

    swiftuiux committed Sep 20, 2024
    Copy the full SHA
    12236fe View commit details
  2. Copy the full SHA
    9652022 View commit details
  3. Update README.md

    swiftuiux committed Sep 20, 2024
    Copy the full SHA
    cd87794 View commit details
  4. Update README.md

    swiftuiux committed Sep 20, 2024
    Copy the full SHA
    ac4601f View commit details

Commits on Nov 26, 2024

  1. update

    swiftuiux committed Nov 26, 2024
    Copy the full SHA
    cd60e15 View commit details
  2. update

    swiftuiux committed Nov 26, 2024
    Copy the full SHA
    378228f View commit details

Commits on Nov 27, 2024

  1. Update Package.swift

    swiftuiux committed Nov 27, 2024
    Copy the full SHA
    cd337d7 View commit details
  2. Update Package.resolved

    swiftuiux committed Nov 27, 2024
    Copy the full SHA
    b6dc4bc View commit details
  3. update

    swiftuiux committed Nov 27, 2024
    Copy the full SHA
    dbebdad View commit details
  4. Update README.md

    swiftuiux committed Nov 27, 2024
    Copy the full SHA
    60ce51a View commit details
  5. Update README.md

    swiftuiux committed Nov 27, 2024
    Copy the full SHA
    92d3a87 View commit details

Commits on Nov 28, 2024

  1. update

    swiftuiux committed Nov 28, 2024
    Copy the full SHA
    6c511fc View commit details

Commits on Nov 29, 2024

  1. update

    swiftuiux committed Nov 29, 2024
    Copy the full SHA
    d13ebdb View commit details

Commits on Nov 30, 2024

  1. Update LICENSE

    swiftuiux authored Nov 30, 2024
    Copy the full SHA
    439aba5 View commit details

Commits on Dec 1, 2024

  1. update

    swiftuiux committed Dec 1, 2024
    Copy the full SHA
    f33d701 View commit details
  2. Copy the full SHA
    9726d0e View commit details
  3. update

    swiftuiux committed Dec 1, 2024
    Copy the full SHA
    5cec6b9 View commit details

Commits on Dec 10, 2024

  1. Update README.md

    swiftuiux committed Dec 10, 2024
    Copy the full SHA
    cc9ddaa View commit details
  2. Update README.md

    swiftuiux committed Dec 10, 2024
    Copy the full SHA
    47bb4c6 View commit details
  3. Copy the full SHA
    475b853 View commit details
  4. Update .gitignore

    swiftuiux authored Dec 10, 2024
    Copy the full SHA
    2d833aa View commit details
  5. Delete .DS_Store

    swiftuiux authored Dec 10, 2024
    Copy the full SHA
    c5c7d0c View commit details
  6. Copy the full SHA
    ca6f212 View commit details
  7. Update README.md

    swiftuiux committed Dec 10, 2024
    Copy the full SHA
    8c31114 View commit details

Commits on Dec 12, 2024

  1. Update README.md

    swiftuiux committed Dec 12, 2024
    Copy the full SHA
    89a9bc3 View commit details
Binary file removed .DS_Store
Binary file not shown.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -88,3 +88,4 @@ fastlane/test_output
# https://github.com/johnno1962/injectionforxcode

iOSInjectionProject/
.DS_Store
4 changes: 4 additions & 0 deletions .spi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
version: 1
builder:
configs:
- documentation_targets: [openai-async-image-swiftui]
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2023 Igor
Copyright (c) 2023 Igor Shelopaev

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
21 changes: 15 additions & 6 deletions Package.resolved
Original file line number Diff line number Diff line change
@@ -3,19 +3,28 @@
{
"identity" : "async-http-client",
"kind" : "remoteSourceControl",
"location" : "https://github.com/The-Igor/async-http-client.git",
"location" : "https://github.com/swiftuiux/async-http-client.git",
"state" : {
"revision" : "8be7d1c1f036350a8109b075052a71d3353ad366",
"version" : "1.4.4"
"revision" : "936a6e953d3c3e05a14c3d852fea9955e57c9854",
"version" : "1.5.0"
}
},
{
"identity" : "async-task",
"kind" : "remoteSourceControl",
"location" : "https://github.com/swiftuiux/async-task.git",
"state" : {
"revision" : "d05dc1ec967813392da38e3501dfe666098baaec",
"version" : "1.2.5"
}
},
{
"identity" : "retry-policy-service",
"kind" : "remoteSourceControl",
"location" : "https://github.com/The-Igor/retry-policy-service.git",
"location" : "https://github.com/swiftuiux/retry-policy-service.git",
"state" : {
"revision" : "46ded002161a95c6b08ddd02c3f319891c773d14",
"version" : "1.0.0"
"revision" : "2a6a1f057fbf77337dfc73db98bd3d538127b3e2",
"version" : "1.0.1"
}
}
],
5 changes: 3 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -14,14 +14,15 @@ let package = Package(
],
dependencies: [
// Dependencies declare other packages that this package depends on.
.package(url: "https://github.com/The-Igor/async-http-client.git", from: "1.4.4")
.package(url: "https://github.com/swiftuiux/async-http-client.git", from: "1.5.0"),
.package(url: "https://github.com/swiftuiux/async-task.git", from: "1.2.5")
],
targets: [
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
// Targets can depend on other targets in this package, and on products in packages this package depends on.
.target(
name: "openai-async-image-swiftui",
dependencies: ["async-http-client"]),
dependencies: ["async-http-client", "async-task"]),
.testTarget(
name: "openai-async-image-swiftuiTests",
dependencies: ["openai-async-image-swiftui"]),
36 changes: 17 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -2,20 +2,22 @@

SwiftUI view that asynchronously loads and displays an OpenAI image from open API

You just type in any your idea and AI will give you an art solution
### Please star the repository if you believe continuing the development of this package is worthwhile. This will help me understand which package deserves more effort.

DALL-E and DALL-E 2 are deep learning models developed by OpenAI to generate digital images from natural language descriptions, called "prompts"
[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Fswiftuiux%2Fopenai-async-image-swiftui%2Fbadge%3Ftype%3Dplatforms)](https://swiftpackageindex.com/swiftuiux/openai-async-image-swiftui)

## [Example for the package](https://github.com/swiftuiux/openai-async-image-swiftui-example)
## [Documentation(API)](https://swiftpackageindex.com/swiftuiux/openai-async-image-swiftui/main/documentation/openai_async_image_swiftui)

[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2FThe-Igor%2Fopenai-async-image-swiftui%2Fbadge%3Ftype%3Dswift-versions)](https://swiftpackageindex.com/The-Igor/openai-async-image-swiftui)
[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2FThe-Igor%2Fopenai-async-image-swiftui%2Fbadge%3Ftype%3Dplatforms)](https://swiftpackageindex.com/The-Igor/openai-async-image-swiftui)

## Features
- [x] Multiplatform iOS, macOS, watchOS and tvOS
- [x] Customizable in term of SwiftUI Image specs [renderingMode, resizable, antialiased...]
- [x] Customizable in term of the transport layer [Loader]
- [x] Based on interfaces not implementations
- [x] Supports multiple platforms: iOS, macOS, watchOS, and tvOS
- [x] Customizable with SwiftUI Image properties (e.g., `renderingMode`, `resizable`, `antialiased`)
- [x] Configurable transport layer via custom `Loader`
- [x] Designed with interfaces, not implementations
- [x] Fully leverages Swift's new concurrency model

![OpenAI AsyncImage SwiftUI](https://github.com/The-Igor/openai-async-image-swiftui/blob/main/image/sun_watch.png)
![OpenAI AsyncImage SwiftUI](https://github.com/swiftuiux/openai-async-image-swiftui/blob/main/image/sun_watch.png)

## How to use

@@ -59,31 +61,27 @@ or with custom **ViewBuilder**
| tpl | Custom view builder tpl |
| loader | Custom loader if you need something specific|

![OpenAI AsyncImage SwiftUI](https://github.com/The-Igor/openai-async-image-swiftui/blob/main/image/appletv_art.png)
![OpenAI AsyncImage SwiftUI](https://github.com/swiftuiux/openai-async-image-swiftui/blob/main/image/appletv_art.png)

## Documentation(API)
- You need to have Xcode 13 installed in order to have access to Documentation Compiler (DocC)
- Go to Product > Build Documentation or **⌃⇧⌘ D**

## SwiftUI example for the package

[OpenAI AsyncImage SwiftUI example](https://github.com/The-Igor/openai-async-image-swiftui-example)


![OpenAI AsyncImage SwiftUI](https://github.com/The-Igor/openai-async-image-swiftui/blob/main/image/sun_11.png)
![OpenAI AsyncImage SwiftUI](https://github.com/swiftuiux/openai-async-image-swiftui/blob/main/image/sun_11.png)

## More Stable Diffusion examples

### Replicate toolkit for swift. Set of diffusion models
Announced in 2022, OpenAI's text-to-image model DALL-E 2 is a recent example of diffusion models. It uses diffusion models for both the model's prior (which produces an image embedding given a text caption) and the decoder that generates the final image.
In machine learning, diffusion models, also known as diffusion probabilistic models, are a class of latent variable models. They are Markov chains trained using variational inference. The goal of diffusion models is to learn the latent structure of a dataset by modeling the way in which data points diffuse through the latent space.
Diffusion models can be applied to a variety of tasks, including image denoising, inpainting, super-resolution, and image generation. For example, an image generation model would start with a random noise image and then, after having been trained reversing the diffusion process on natural images, the model would be able to generate new natural images.
[Replicate kit](https://github.com/The-Igor/replicate-kit-swift)
[Replicate kit](https://github.com/swiftuiux/replicate-kit-swift)


![The concept](https://github.com/The-Igor/replicate-kit-swift/raw/main/img/image_02.png)
![The concept](https://github.com/swiftuiux/replicate-kit-swift/raw/main/img/image_02.png)

### CoreML Stable Diffusion
[The example app](https://github.com/The-Igor/coreml-stable-diffusion-swift-example) for running text-to-image or image-to-image models to generate images using Apple's Core ML Stable Diffusion implementation
[The example app](https://github.com/swiftuiux/coreml-stable-diffusion-swift-example) for running text-to-image or image-to-image models to generate images using Apple's Core ML Stable Diffusion implementation

![The concept](https://github.com/The-Igor/coreml-stable-diffusion-swift-example/blob/main/img/img_01.png)
![The concept](https://github.com/swiftuiux/coreml-stable-diffusion-swift-example/blob/main/img/img_01.png)
Loading