madebyollin / maple-diffusion

Stable Diffusion inference on iOS / macOS using MPSGraph
https://madebyoll.in/posts/maple_diffusion/
MIT License
793 stars 51 forks source link

Feature request: Share/save/export/drag-drop image #10

Open jackpal opened 1 year ago

jackpal commented 1 year ago

This app works great, and as soon as I saw it generate an image, I wanted to share it. It's pretty easy to hook up SwiftUI share sheets by using ShareLink: https://www.hackingwithswift.com/quick-start/swiftui/how-to-let-users-share-content-using-the-system-share-sheet

madebyollin commented 1 year ago

Good idea! I added tap-to-share on iOS using ShareLink like you suggested. I couldn't find an easy way to add image export on macOS (ShareLink seemingly isn't supported in Monterey?) so I've ifdef'd it as iOS-only for now. If you know of a good way to share CGimages on macOS without introducing a bunch of extra code, lmk :)

jackpal commented 1 year ago

Thanks!! On macOS maybe saving to the clipboard would be the easiest way to support exporting. I haven't tried it, but this thread seems promising: https://developer.apple.com/forums/thread/115198