├── .gitattributes ├── LICENSE ├── README.md ├── StableDiffusion.dpr ├── StableDiffusion.dproj ├── Unit1.fmx ├── Unit1.pas ├── Unit1.vlb ├── screenshot.jpg ├── uCard.fmx ├── uCard.pas ├── uCard.vlb ├── uCircle.fmx ├── uCircle.pas ├── uDM.dfm └── uDM.pas /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 FMXExpress 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Stable Diffusion Desktop Client 2 | Stable Diffusion Desktop client for Windows, macOS, and Linux built in Embarcadero Delphi. 3 | 4 | The Stable Diffusion Desktop client is a powerful UI for creating images using Stable Diffusion and models fine-tuned on Stable Diffusion like: 5 | 6 | * SDXL 7 | * Stable Diffusion 1.5 8 | * DreamShaper 9 | * Kandinsky-2 10 | * DeepFloyd IF 11 | * OpenJourney 12 | * Analog Diffusion 13 | * PortraitPlus 14 | * Elden Ring Diffusion 15 | * Stable Diffusion 2.1 16 | * Stable Diffusion Long Prompts 17 | * Future Diffusion 18 | * Anything v3 19 | * Anything v4 20 | * Waifu Diffusion 21 | * HASDX 22 | * Deliberate 23 | * Vintedois Diffusion 24 | * WavyFusion 25 | * Eimis Anime Diffusion 26 | * RPG 27 | * Realistic Vision v2.0 28 | * Opengen 29 | * Cyberrealistic 30 | * Meinamix 31 | * Edge of Realism 32 | * Lyriel 33 | * BRA 34 | * Babes 35 | * Neverending Dream 36 | * AbsoluteBeauty 37 | * Realistic Vision v3.0 38 | * Illuminutty Diffusion 39 | * Realistic Vision v5.1 40 | 41 | Upscaling / facefixing from: 42 | 43 | * Codeformer (facefix) 44 | * Real-ESRGAN 45 | * Swin2SR 46 | * GFPGAN (facefix) 47 | * Swinir 48 | * Rundalle-sr 49 | * Esrgan 50 | 51 | Supports Image2Image on a subset of models. 52 | 53 | Includes the ability to enhance a prompt using AI via the DistilGPT2 Stable Diffusion V2 model. 54 | 55 | Copy a FMX TImage directly from the client into the Delphi IDE! 56 | 57 | Built with [Delphi](https://www.embarcadero.com/products/delphi/) using the FireMonkey framework this client works on Windows, macOS, and Linux (and maybe Android+iOS) with a single codebase and single UI. At the moment it is specifically set up for Windows. 58 | 59 | It also features a REST integration with Replicate.com for providing Generate Image functionality within the client. You need to sign up for an API key to access that functionality. 60 | 61 | # Stable Diffusion Desktop client Screeshot on Windows 62 | ![Stable Diffusion Desktop client on Windows](/screenshot.jpg) 63 | 64 | Requires [Skia4Delphi](https://github.com/skia4delphi/skia4delphi) to compile. 65 | 66 | Other Delphi AI clients: 67 | 68 | [CodeDroidAI](https://github.com/FMXExpress/CodeDroidAI) 69 | 70 | [ControlNet Sketch To Image](https://github.com/FMXExpress/ControlNet-Sketch-To-Image) 71 | 72 | [AutoBlogAI](https://github.com/FMXExpress/AutoBlogAI) 73 | 74 | [AI Code Translator](https://github.com/FMXExpress/AI-Code-Translator) 75 | 76 | [AI Playground](https://github.com/FMXExpress/AI-Playground-DesktopClient) 77 | 78 | [Song Writer AI](https://github.com/FMXExpress/Song-Writer-AI) 79 | 80 | [Stable Diffusion Text To Image Prompts](https://github.com/FMXExpress/Stable-Diffusion-Text-To-Image-Prompts) 81 | 82 | [Generative AI Prompts](https://github.com/FMXExpress/Generative-AI-Prompts) 83 | 84 | [Dreambooth Desktop Client](https://github.com/FMXExpress/DreamBooth-Desktop-Client) 85 | 86 | [Text To Vector Desktop Client](https://github.com/FMXExpress/Text-To-Vector-Desktop-Client) 87 | -------------------------------------------------------------------------------- /StableDiffusion.dpr: -------------------------------------------------------------------------------- 1 | program StableDiffusion; 2 | 3 | uses 4 | System.StartUpCopy, 5 | FMX.Forms, 6 | Skia.FMX, 7 | Unit1 in 'Unit1.pas' {MainForm}, 8 | uCircle in 'uCircle.pas' {CircleFrame: TFrame}, 9 | uCard in 'uCard.pas' {CardFrame: TFrame}, 10 | uDM in 'uDM.pas' {DM: TDataModule}; 11 | 12 | {$R *.res} 13 | 14 | begin 15 | GlobalUseSkia := True; 16 | Application.Initialize; 17 | Application.CreateForm(TMainForm, MainForm); 18 | Application.CreateForm(TDM, DM); 19 | Application.Run; 20 | end. 21 | -------------------------------------------------------------------------------- /StableDiffusion.dproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | {635CE580-AC66-49C3-8148-F85B542C11D6} 4 | 19.5 5 | FMX 6 | StableDiffusion.dpr 7 | True 8 | Release 9 | Win32 10 | 558099 11 | Application 12 | 13 | 14 | true 15 | 16 | 17 | true 18 | Base 19 | true 20 | 21 | 22 | true 23 | Base 24 | true 25 | 26 | 27 | true 28 | Base 29 | true 30 | 31 | 32 | true 33 | Base 34 | true 35 | 36 | 37 | true 38 | Base 39 | true 40 | 41 | 42 | true 43 | Base 44 | true 45 | 46 | 47 | true 48 | Base 49 | true 50 | 51 | 52 | true 53 | Base 54 | true 55 | 56 | 57 | true 58 | Base 59 | true 60 | 61 | 62 | true 63 | Cfg_1 64 | true 65 | true 66 | 67 | 68 | true 69 | Cfg_1 70 | true 71 | true 72 | 73 | 74 | true 75 | Base 76 | true 77 | 78 | 79 | true 80 | Cfg_2 81 | true 82 | true 83 | 84 | 85 | true 86 | Cfg_2 87 | true 88 | true 89 | 90 | 91 | .\$(Platform)\$(Config) 92 | .\$(Platform)\$(Config) 93 | false 94 | false 95 | false 96 | false 97 | false 98 | System;Xml;Data;Datasnap;Web;Soap;$(DCC_Namespace) 99 | true 100 | true 101 | true 102 | true 103 | true 104 | true 105 | true 106 | true 107 | $(BDS)\bin\delphi_PROJECTICON.ico 108 | $(BDS)\bin\delphi_PROJECTICNS.icns 109 | StableDiffusion 110 | SKIA;$(DCC_Define) 111 | 112 | 113 | DBXSqliteDriver;RESTComponents;DBXInterBaseDriver;emsclientfiredac;tethering;DataSnapFireDAC;bindcompfmx;FmxTeeUI;fmx;FireDACIBDriver;RadiantShapesFmx;FireDACDBXDriver;dbexpress;IndyCore;dsnap;emsclient;DataSnapCommon;FireDACCommon;RESTBackendComponents;soapserver;TMSLoggingPkgFMXDXE12;SampleListViewRatingsAppearancePackage;bindengine;CloudService;FireDACCommonDriver;DataSnapClient;inet;IndyIPCommon;bindcompdbx;IndyIPServer;IndySystem;fmxFireDAC;FireDAC;FireDACSqliteDriver;FMXTee;soaprtl;DbxCommonDriver;xmlrtl;soapmidas;DataSnapNativeClient;FireDACDSDriver;rtl;DbxClientDriver;CustomIPTransport;bindcomp;IndyIPClient;TMSLoggingPkgCoreDXE12;dbxcds;RadiantShapesFmx_Design;dsnapxml;DataSnapProviderClient;dbrtl;IndyProtocols;$(DCC_UsePackage) 114 | package=com.embarcadero.$(MSBuildProjectName);label=$(MSBuildProjectName);versionCode=1;versionName=1.0.0;persistent=False;restoreAnyVersion=False;installLocation=auto;largeHeap=False;theme=TitleBar;hardwareAccelerated=true;apiKey= 115 | Debug 116 | true 117 | $(BDS)\bin\Artwork\Android\FM_LauncherIcon_36x36.png 118 | $(BDS)\bin\Artwork\Android\FM_LauncherIcon_48x48.png 119 | $(BDS)\bin\Artwork\Android\FM_LauncherIcon_72x72.png 120 | $(BDS)\bin\Artwork\Android\FM_LauncherIcon_96x96.png 121 | $(BDS)\bin\Artwork\Android\FM_LauncherIcon_144x144.png 122 | $(BDS)\bin\Artwork\Android\FM_SplashImage_426x320.png 123 | $(BDS)\bin\Artwork\Android\FM_SplashImage_470x320.png 124 | $(BDS)\bin\Artwork\Android\FM_SplashImage_640x480.png 125 | $(BDS)\bin\Artwork\Android\FM_SplashImage_960x720.png 126 | $(BDS)\bin\Artwork\Android\FM_NotificationIcon_24x24.png 127 | $(BDS)\bin\Artwork\Android\FM_NotificationIcon_36x36.png 128 | $(BDS)\bin\Artwork\Android\FM_NotificationIcon_48x48.png 129 | $(BDS)\bin\Artwork\Android\FM_NotificationIcon_72x72.png 130 | $(BDS)\bin\Artwork\Android\FM_NotificationIcon_96x96.png 131 | android-support-v4.dex.jar;cloud-messaging.dex.jar;com-google-android-gms.play-services-ads-base.17.2.0.dex.jar;com-google-android-gms.play-services-ads-identifier.16.0.0.dex.jar;com-google-android-gms.play-services-ads-lite.17.2.0.dex.jar;com-google-android-gms.play-services-ads.17.2.0.dex.jar;com-google-android-gms.play-services-analytics-impl.16.0.8.dex.jar;com-google-android-gms.play-services-analytics.16.0.8.dex.jar;com-google-android-gms.play-services-base.16.0.1.dex.jar;com-google-android-gms.play-services-basement.16.2.0.dex.jar;com-google-android-gms.play-services-gass.17.2.0.dex.jar;com-google-android-gms.play-services-identity.16.0.0.dex.jar;com-google-android-gms.play-services-maps.16.1.0.dex.jar;com-google-android-gms.play-services-measurement-base.16.4.0.dex.jar;com-google-android-gms.play-services-measurement-sdk-api.16.4.0.dex.jar;com-google-android-gms.play-services-stats.16.0.1.dex.jar;com-google-android-gms.play-services-tagmanager-v4-impl.16.0.8.dex.jar;com-google-android-gms.play-services-tasks.16.0.1.dex.jar;com-google-android-gms.play-services-wallet.16.0.1.dex.jar;com-google-firebase.firebase-analytics.16.4.0.dex.jar;com-google-firebase.firebase-common.16.1.0.dex.jar;com-google-firebase.firebase-iid-interop.16.0.1.dex.jar;com-google-firebase.firebase-iid.17.1.1.dex.jar;com-google-firebase.firebase-measurement-connector.17.0.1.dex.jar;com-google-firebase.firebase-messaging.17.5.0.dex.jar;fmx.dex.jar;google-play-billing.dex.jar;google-play-licensing.dex.jar 132 | $(BDS)\bin\Artwork\Android\FM_LauncherIcon_192x192.png 133 | 134 | 135 | package=com.embarcadero.$(MSBuildProjectName);label=$(MSBuildProjectName);versionCode=1;versionName=1.0.0;persistent=False;restoreAnyVersion=False;installLocation=auto;largeHeap=False;theme=TitleBar;hardwareAccelerated=true;apiKey= 136 | Debug 137 | true 138 | true 139 | Base 140 | true 141 | DBXSqliteDriver;RESTComponents;DBXInterBaseDriver;emsclientfiredac;tethering;DataSnapFireDAC;bindcompfmx;FmxTeeUI;fmx;FireDACIBDriver;RadiantShapesFmx;FireDACDBXDriver;dbexpress;IndyCore;dsnap;emsclient;DataSnapCommon;FireDACCommon;RESTBackendComponents;soapserver;TMSLoggingPkgFMXDXE12;SampleListViewRatingsAppearancePackage;bindengine;CloudService;FireDACCommonDriver;DataSnapClient;inet;IndyIPCommon;bindcompdbx;IndyIPServer;IndySystem;fmxFireDAC;FireDAC;FireDACSqliteDriver;FMXTee;soaprtl;DbxCommonDriver;xmlrtl;soapmidas;DataSnapNativeClient;FireDACDSDriver;rtl;DbxClientDriver;CustomIPTransport;bindcomp;IndyIPClient;TMSLoggingPkgCoreDXE12;dbxcds;RadiantShapesFmx_Design;dsnapxml;DataSnapProviderClient;dbrtl;IndyProtocols;$(DCC_UsePackage);$(DCC_UsePackage) 142 | $(BDS)\bin\Artwork\Android\FM_LauncherIcon_36x36.png 143 | $(BDS)\bin\Artwork\Android\FM_LauncherIcon_48x48.png 144 | $(BDS)\bin\Artwork\Android\FM_LauncherIcon_72x72.png 145 | $(BDS)\bin\Artwork\Android\FM_LauncherIcon_96x96.png 146 | $(BDS)\bin\Artwork\Android\FM_LauncherIcon_144x144.png 147 | $(BDS)\bin\Artwork\Android\FM_SplashImage_426x320.png 148 | $(BDS)\bin\Artwork\Android\FM_SplashImage_470x320.png 149 | $(BDS)\bin\Artwork\Android\FM_SplashImage_640x480.png 150 | $(BDS)\bin\Artwork\Android\FM_SplashImage_960x720.png 151 | $(BDS)\bin\Artwork\Android\FM_NotificationIcon_24x24.png 152 | $(BDS)\bin\Artwork\Android\FM_NotificationIcon_36x36.png 153 | $(BDS)\bin\Artwork\Android\FM_NotificationIcon_48x48.png 154 | $(BDS)\bin\Artwork\Android\FM_NotificationIcon_72x72.png 155 | $(BDS)\bin\Artwork\Android\FM_NotificationIcon_96x96.png 156 | android-support-v4.dex.jar;cloud-messaging.dex.jar;com-google-android-gms.play-services-ads-base.17.2.0.dex.jar;com-google-android-gms.play-services-ads-identifier.16.0.0.dex.jar;com-google-android-gms.play-services-ads-lite.17.2.0.dex.jar;com-google-android-gms.play-services-ads.17.2.0.dex.jar;com-google-android-gms.play-services-analytics-impl.16.0.8.dex.jar;com-google-android-gms.play-services-analytics.16.0.8.dex.jar;com-google-android-gms.play-services-base.16.0.1.dex.jar;com-google-android-gms.play-services-basement.16.2.0.dex.jar;com-google-android-gms.play-services-gass.17.2.0.dex.jar;com-google-android-gms.play-services-identity.16.0.0.dex.jar;com-google-android-gms.play-services-maps.16.1.0.dex.jar;com-google-android-gms.play-services-measurement-base.16.4.0.dex.jar;com-google-android-gms.play-services-measurement-sdk-api.16.4.0.dex.jar;com-google-android-gms.play-services-stats.16.0.1.dex.jar;com-google-android-gms.play-services-tagmanager-v4-impl.16.0.8.dex.jar;com-google-android-gms.play-services-tasks.16.0.1.dex.jar;com-google-android-gms.play-services-wallet.16.0.1.dex.jar;com-google-firebase.firebase-analytics.16.4.0.dex.jar;com-google-firebase.firebase-common.16.1.0.dex.jar;com-google-firebase.firebase-iid-interop.16.0.1.dex.jar;com-google-firebase.firebase-iid.17.1.1.dex.jar;com-google-firebase.firebase-measurement-connector.17.0.1.dex.jar;com-google-firebase.firebase-messaging.17.5.0.dex.jar;fmx.dex.jar;google-play-billing.dex.jar;google-play-licensing.dex.jar 157 | $(BDS)\bin\Artwork\Android\FM_LauncherIcon_192x192.png 158 | 159 | 160 | DBXSqliteDriver;RESTComponents;fmxase;DBXInterBaseDriver;emsclientfiredac;tethering;DataSnapFireDAC;bindcompfmx;FmxTeeUI;fmx;FireDACIBDriver;RadiantShapesFmx;FireDACDBXDriver;dbexpress;IndyCore;dsnap;emsclient;DataSnapCommon;FireDACCommon;RESTBackendComponents;soapserver;TMSLoggingPkgFMXDXE12;SampleListViewRatingsAppearancePackage;bindengine;CloudService;FireDACCommonDriver;TMSFMXWebGMapsPkgDXE12;DataSnapClient;inet;IndyIPCommon;bindcompdbx;IndyIPServer;TMSFMXCloudPackPkgDXE12;IndySystem;fmxFireDAC;FireDAC;TMSFMXChartPkgDXE12;FireDACSqliteDriver;FMXTee;soaprtl;DbxCommonDriver;xmlrtl;soapmidas;DataSnapNativeClient;FireDACDSDriver;rtl;DbxClientDriver;CustomIPTransport;bindcomp;fgx;IndyIPClient;TMSLoggingPkgCoreDXE12;dbxcds;TMSFMXPackPkgDXE12;RadiantShapesFmx_Design;dsnapxml;DataSnapProviderClient;dbrtl;IndyProtocols;$(DCC_UsePackage) 161 | CFBundleName=$(MSBuildProjectName);CFBundleDevelopmentRegion=en;CFBundleDisplayName=$(MSBuildProjectName);CFBundleIdentifier=$(MSBuildProjectName);CFBundleInfoDictionaryVersion=7.1;CFBundleVersion=1.0.0;CFBundleShortVersionString=1.0.0;CFBundlePackageType=APPL;CFBundleSignature=????;LSRequiresIPhoneOS=true;CFBundleAllowMixedLocalizations=YES;CFBundleExecutable=$(MSBuildProjectName);UIDeviceFamily=iPhone & iPad;NSLocationAlwaysUsageDescription=The reason for accessing the location information of the user;NSLocationWhenInUseUsageDescription=The reason for accessing the location information of the user;NSLocationAlwaysAndWhenInUseUsageDescription=The reason for accessing the location information of the user;UIBackgroundModes=;NSContactsUsageDescription=The reason for accessing the contacts;NSPhotoLibraryUsageDescription=The reason for accessing the photo library;NSPhotoLibraryAddUsageDescription=The reason for adding to the photo library;NSCameraUsageDescription=The reason for accessing the camera;NSFaceIDUsageDescription=The reason for accessing the face id;NSMicrophoneUsageDescription=The reason for accessing the microphone;NSSiriUsageDescription=The reason for accessing Siri;ITSAppUsesNonExemptEncryption=false;NSBluetoothAlwaysUsageDescription=The reason for accessing bluetooth;NSBluetoothPeripheralUsageDescription=The reason for accessing bluetooth peripherals;NSCalendarsUsageDescription=The reason for accessing the calendar data;NSRemindersUsageDescription=The reason for accessing the reminders;NSMotionUsageDescription=The reason for accessing the accelerometer;NSSpeechRecognitionUsageDescription=The reason for requesting to send user data to Apple's speech recognition servers 162 | iPhoneAndiPad 163 | true 164 | Debug 165 | $(MSBuildProjectName) 166 | $(BDS)\bin\Artwork\iOS\iPhone\FM_ApplicationIcon_120x120.png 167 | $(BDS)\bin\Artwork\iOS\iPhone\FM_ApplicationIcon_180x180.png 168 | $(BDS)\bin\Artwork\iOS\iPhone\FM_SpotlightSearchIcon_80x80.png 169 | $(BDS)\bin\Artwork\iOS\iPhone\FM_SpotlightSearchIcon_120x120.png 170 | $(BDS)\bin\Artwork\iOS\iPad\FM_ApplicationIcon_152x152.png 171 | $(BDS)\bin\Artwork\iOS\iPad\FM_ApplicationIcon_167x167.png 172 | $(BDS)\bin\Artwork\iOS\iPad\FM_SpotlightSearchIcon_80x80.png 173 | $(BDS)\bin\Artwork\iOS\iPad\FM_SettingIcon_58x58.png 174 | $(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImage_2x.png 175 | $(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImageDark_2x.png 176 | $(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImage_3x.png 177 | $(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImageDark_3x.png 178 | $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImage_2x.png 179 | $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImageDark_2x.png 180 | $(BDS)\bin\Artwork\iOS\iPhone\FM_ApplicationIcon_1024x1024.png 181 | $(BDS)\bin\Artwork\iOS\iPhone\FM_NotificationIcon_60x60.png 182 | $(BDS)\bin\Artwork\iOS\iPhone\FM_SettingIcon_87x87.png 183 | $(BDS)\bin\Artwork\iOS\iPhone\FM_NotificationIcon_40x40.png 184 | $(BDS)\bin\Artwork\iOS\iPhone\FM_SettingIcon_58x58.png 185 | $(BDS)\bin\Artwork\iOS\iPad\FM_NotificationIcon_40x40.png 186 | 187 | 188 | CFBundleName=$(MSBuildProjectName);CFBundleDevelopmentRegion=en;CFBundleDisplayName=$(MSBuildProjectName);CFBundleIdentifier=$(MSBuildProjectName);CFBundleInfoDictionaryVersion=7.1;CFBundleVersion=1.0.0;CFBundleShortVersionString=1.0.0;CFBundlePackageType=APPL;CFBundleSignature=????;LSRequiresIPhoneOS=true;CFBundleAllowMixedLocalizations=YES;CFBundleExecutable=$(MSBuildProjectName);UIDeviceFamily=iPhone & iPad;NSLocationAlwaysUsageDescription=The reason for accessing the location information of the user;NSLocationWhenInUseUsageDescription=The reason for accessing the location information of the user;NSLocationAlwaysAndWhenInUseUsageDescription=The reason for accessing the location information of the user;UIBackgroundModes=;NSContactsUsageDescription=The reason for accessing the contacts;NSPhotoLibraryUsageDescription=The reason for accessing the photo library;NSPhotoLibraryAddUsageDescription=The reason for adding to the photo library;NSCameraUsageDescription=The reason for accessing the camera;NSFaceIDUsageDescription=The reason for accessing the face id;NSMicrophoneUsageDescription=The reason for accessing the microphone;NSSiriUsageDescription=The reason for accessing Siri;ITSAppUsesNonExemptEncryption=false;NSBluetoothAlwaysUsageDescription=The reason for accessing bluetooth;NSBluetoothPeripheralUsageDescription=The reason for accessing bluetooth peripherals;NSCalendarsUsageDescription=The reason for accessing the calendar data;NSRemindersUsageDescription=The reason for accessing the reminders;NSMotionUsageDescription=The reason for accessing the accelerometer;NSSpeechRecognitionUsageDescription=The reason for requesting to send user data to Apple's speech recognition servers 189 | iPhoneAndiPad 190 | true 191 | DBXSqliteDriver;RESTComponents;fmxase;DBXInterBaseDriver;emsclientfiredac;tethering;DataSnapFireDAC;bindcompfmx;FmxTeeUI;fmx;FireDACIBDriver;RadiantShapesFmx;FireDACDBXDriver;dbexpress;IndyCore;dsnap;emsclient;DataSnapCommon;FireDACCommon;RESTBackendComponents;soapserver;TMSLoggingPkgFMXDXE12;SampleListViewRatingsAppearancePackage;bindengine;CloudService;FireDACCommonDriver;TMSFMXWebGMapsPkgDXE12;DataSnapClient;inet;IndyIPCommon;bindcompdbx;IndyIPServer;TMSFMXCloudPackPkgDXE12;IndySystem;fmxFireDAC;FireDAC;TMSFMXChartPkgDXE12;FireDACSqliteDriver;FMXTee;soaprtl;DbxCommonDriver;xmlrtl;soapmidas;DataSnapNativeClient;FireDACDSDriver;rtl;DbxClientDriver;CustomIPTransport;bindcomp;fgx;IndyIPClient;TMSLoggingPkgCoreDXE12;dbxcds;TMSFMXPackPkgDXE12;RadiantShapesFmx_Design;dsnapxml;DataSnapProviderClient;dbrtl;IndyProtocols;$(DCC_UsePackage);$(DCC_UsePackage) 192 | $(BDS)\bin\Artwork\iOS\iPhone\FM_ApplicationIcon_120x120.png 193 | $(BDS)\bin\Artwork\iOS\iPhone\FM_ApplicationIcon_180x180.png 194 | $(BDS)\bin\Artwork\iOS\iPhone\FM_SpotlightSearchIcon_80x80.png 195 | $(BDS)\bin\Artwork\iOS\iPhone\FM_SpotlightSearchIcon_120x120.png 196 | $(BDS)\bin\Artwork\iOS\iPad\FM_ApplicationIcon_152x152.png 197 | $(BDS)\bin\Artwork\iOS\iPad\FM_ApplicationIcon_167x167.png 198 | $(BDS)\bin\Artwork\iOS\iPad\FM_SpotlightSearchIcon_80x80.png 199 | $(BDS)\bin\Artwork\iOS\iPad\FM_SettingIcon_58x58.png 200 | $(BDS)\bin\Artwork\iOS\iPhone\FM_ApplicationIcon_1024x1024.png 201 | $(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImage_2x.png 202 | $(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImageDark_2x.png 203 | $(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImage_3x.png 204 | $(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImageDark_3x.png 205 | $(BDS)\bin\Artwork\iOS\iPhone\FM_SettingIcon_58x58.png 206 | $(BDS)\bin\Artwork\iOS\iPhone\FM_SettingIcon_87x87.png 207 | $(BDS)\bin\Artwork\iOS\iPhone\FM_NotificationIcon_40x40.png 208 | $(BDS)\bin\Artwork\iOS\iPhone\FM_NotificationIcon_60x60.png 209 | $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImage_2x.png 210 | $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImageDark_2x.png 211 | $(BDS)\bin\Artwork\iOS\iPad\FM_NotificationIcon_40x40.png 212 | 213 | 214 | CFBundleName=$(MSBuildProjectName);CFBundleDisplayName=$(MSBuildProjectName);CFBundleIdentifier=$(MSBuildProjectName);CFBundleVersion=1.0.0;CFBundleShortVersionString=1.0.0;CFBundlePackageType=APPL;CFBundleSignature=????;CFBundleAllowMixedLocalizations=YES;CFBundleExecutable=$(MSBuildProjectName);NSHighResolutionCapable=true;LSApplicationCategoryType=public.app-category.utilities;NSLocationUsageDescription=The reason for accessing the location information of the user;NSContactsUsageDescription=The reason for accessing the contacts;NSCalendarsUsageDescription=The reason for accessing the calendar data;NSRemindersUsageDescription=The reason for accessing the reminders;NSCameraUsageDescription=The reason for accessing the camera;NSMicrophoneUsageDescription=The reason for accessing the microphone;NSMotionUsageDescription=The reason for accessing the accelerometer;NSDesktopFolderUsageDescription=The reason for accessing the Desktop folder;NSDocumentsFolderUsageDescription=The reason for accessing the Documents folder;NSDownloadsFolderUsageDescription=The reason for accessing the Downloads folder;NSNetworkVolumesUsageDescription=The reason for accessing files on a network volume;NSRemovableVolumesUsageDescription=The reason for accessing files on a removable volume;NSSpeechRecognitionUsageDescription=The reason for requesting to send user data to Apple's speech recognition servers 215 | Debug 216 | true 217 | 218 | 219 | CFBundleName=$(MSBuildProjectName);CFBundleDisplayName=$(MSBuildProjectName);CFBundleIdentifier=$(MSBuildProjectName);CFBundleVersion=1.0.0;CFBundleShortVersionString=1.0.0;CFBundlePackageType=APPL;CFBundleSignature=????;CFBundleAllowMixedLocalizations=YES;CFBundleExecutable=$(MSBuildProjectName);NSHighResolutionCapable=true;LSApplicationCategoryType=public.app-category.utilities;NSLocationUsageDescription=The reason for accessing the location information of the user;NSContactsUsageDescription=The reason for accessing the contacts;NSCalendarsUsageDescription=The reason for accessing the calendar data;NSRemindersUsageDescription=The reason for accessing the reminders;NSCameraUsageDescription=The reason for accessing the camera;NSMicrophoneUsageDescription=The reason for accessing the microphone;NSMotionUsageDescription=The reason for accessing the accelerometer;NSDesktopFolderUsageDescription=The reason for accessing the Desktop folder;NSDocumentsFolderUsageDescription=The reason for accessing the Documents folder;NSDownloadsFolderUsageDescription=The reason for accessing the Downloads folder;NSNetworkVolumesUsageDescription=The reason for accessing files on a network volume;NSRemovableVolumesUsageDescription=The reason for accessing files on a removable volume;NSSpeechRecognitionUsageDescription=The reason for requesting to send user data to Apple's speech recognition servers 220 | Debug 221 | true 222 | 223 | 224 | DBXSqliteDriver;RESTComponents;fmxase;DBXDb2Driver;DBXInterBaseDriver;vclactnband;vclFireDAC;TMSmCLPkgDXE12;emsclientfiredac;TMSiCLPkgDXE12;tethering;svnui;DataSnapFireDAC;FireDACADSDriver;DBXMSSQLDriver;DatasnapConnectorsFreePascal;FireDACMSSQLDriver;vcltouch;vcldb;bindcompfmx;svn;DBXOracleDriver;inetdb;TMSFMXCloudPackPkgDEDXE12;FmxTeeUI;emsedge;fmx;FireDACIBDriver;fmxdae;RadiantShapesFmx;FireDACDBXDriver;dbexpress;IndyCore;vclx;dsnap;emsclient;DataSnapCommon;FireDACCommon;RESTBackendComponents;DataSnapConnectors;VCLRESTComponents;soapserver;TMSLoggingPkgFMXDXE12;SampleListViewRatingsAppearancePackage;vclie;bindengine;DBXMySQLDriver;CloudService;FireDACOracleDriver;FireDACMySQLDriver;DBXFirebirdDriver;FireDACCommonODBC;FireDACCommonDriver;TMSFMXWebGMapsPkgDXE12;DataSnapClient;inet;IndyIPCommon;bindcompdbx;vcl;IndyIPServer;DBXSybaseASEDriver;TMSFMXCloudPackPkgDXE12;IndySystem;FireDACDb2Driver;dsnapcon;FireDACMSAccDriver;fmxFireDAC;FireDACInfxDriver;vclimg;TeeDB;FireDAC;TMSFMXChartPkgDXE12;emshosting;FireDACSqliteDriver;FireDACPgDriver;FireDACASADriver;DBXOdbcDriver;FireDACTDataDriver;FMXTee;soaprtl;DbxCommonDriver;Tee;DataSnapServer;xmlrtl;soapmidas;DataSnapNativeClient;fmxobj;vclwinx;FireDACDSDriver;rtl;emsserverresource;DbxClientDriver;DBXSybaseASADriver;CustomIPTransport;vcldsnap;bindcomp;appanalytics;fgx;DBXInformixDriver;TMSLoggingPkgVCLDXE12;IndyIPClient;bindcompvcl;TMSLoggingPkgCoreDXE12;TeeUI;dbxcds;VclSmp;TMSFMXPackPkgDXE12;adortl;FireDACODBCDriver;RadiantShapesFmx_Design;DataSnapIndy10ServerTransport;TMSFMXWebOSMapsPkgDXE12;dsnapxml;DataSnapProviderClient;dbrtl;IndyProtocols;inetdbxpress;FireDACMongoDBDriver;DataSnapServerMidas;$(DCC_UsePackage) 225 | Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace) 226 | Debug 227 | true 228 | CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments= 229 | 1033 230 | $(BDS)\bin\default_app.manifest 231 | $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png 232 | $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png 233 | 234 | 235 | DBXSqliteDriver;RESTComponents;fmxase;DBXDb2Driver;DBXInterBaseDriver;vclactnband;vclFireDAC;emsclientfiredac;tethering;DataSnapFireDAC;FireDACADSDriver;DBXMSSQLDriver;DatasnapConnectorsFreePascal;FireDACMSSQLDriver;vcltouch;vcldb;bindcompfmx;DBXOracleDriver;inetdb;FmxTeeUI;emsedge;fmx;FireDACIBDriver;fmxdae;RadiantShapesFmx;FireDACDBXDriver;dbexpress;IndyCore;vclx;dsnap;emsclient;DataSnapCommon;FireDACCommon;RESTBackendComponents;DataSnapConnectors;VCLRESTComponents;soapserver;TMSLoggingPkgFMXDXE12;vclie;bindengine;DBXMySQLDriver;CloudService;FireDACOracleDriver;FireDACMySQLDriver;DBXFirebirdDriver;FireDACCommonODBC;FireDACCommonDriver;DataSnapClient;inet;IndyIPCommon;bindcompdbx;vcl;IndyIPServer;DBXSybaseASEDriver;IndySystem;FireDACDb2Driver;dsnapcon;FireDACMSAccDriver;fmxFireDAC;FireDACInfxDriver;vclimg;TeeDB;FireDAC;emshosting;FireDACSqliteDriver;FireDACPgDriver;FireDACASADriver;DBXOdbcDriver;FireDACTDataDriver;FMXTee;soaprtl;DbxCommonDriver;Tee;DataSnapServer;xmlrtl;soapmidas;DataSnapNativeClient;fmxobj;vclwinx;FireDACDSDriver;rtl;emsserverresource;DbxClientDriver;DBXSybaseASADriver;CustomIPTransport;vcldsnap;bindcomp;appanalytics;DBXInformixDriver;TMSLoggingPkgVCLDXE12;IndyIPClient;bindcompvcl;TMSLoggingPkgCoreDXE12;TeeUI;dbxcds;VclSmp;adortl;FireDACODBCDriver;RadiantShapesFmx_Design;DataSnapIndy10ServerTransport;dsnapxml;DataSnapProviderClient;dbrtl;IndyProtocols;inetdbxpress;FireDACMongoDBDriver;DataSnapServerMidas;$(DCC_UsePackage) 236 | Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;$(DCC_Namespace) 237 | Debug 238 | true 239 | CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments= 240 | 1033 241 | $(BDS)\bin\default_app.manifest 242 | $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png 243 | $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png 244 | 245 | 246 | DEBUG;$(DCC_Define) 247 | true 248 | false 249 | true 250 | true 251 | true 252 | 253 | 254 | false 255 | true 256 | PerMonitorV2 257 | 258 | 259 | true 260 | PerMonitorV2 261 | 262 | 263 | false 264 | RELEASE;$(DCC_Define) 265 | 0 266 | 0 267 | 268 | 269 | PerMonitorV2 270 | true 271 | 6 272 | 1033 273 | CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.6.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.6.0.0;Comments= 274 | 275 | 276 | true 277 | PerMonitorV2 278 | 279 | 280 | 281 | MainSource 282 | 283 | 284 |
MainForm
285 | fmx 286 |
287 | 288 |
CircleFrame
289 | fmx 290 | TFrame 291 |
292 | 293 |
CardFrame
294 | fmx 295 | TFrame 296 |
297 | 298 |
DM
299 | dfm 300 | TDataModule 301 |
302 | 303 | Base 304 | 305 | 306 | Cfg_1 307 | Base 308 | 309 | 310 | Cfg_2 311 | Base 312 | 313 |
314 | 315 | Delphi.Personality.12 316 | Application 317 | 318 | 319 | 320 | StableDiffusion.dpr 321 | 322 | 323 | Embarcadero C++Builder Office 2000 Servers Package 324 | Embarcadero C++Builder Office XP Servers Package 325 | Microsoft Office 2000 Sample Automation Server Wrapper Components 326 | Microsoft Office XP Sample Automation Server Wrapper Components 327 | 328 | 329 | 330 | 331 | 332 | .\ 333 | 0 334 | sk4d.dll 335 | true 336 | 337 | 338 | 339 | 340 | .\ 341 | 0 342 | sk4d.dll 343 | true 344 | 345 | 346 | 347 | 348 | library\lib\armeabi-v7a\ 349 | 1 350 | libsk4d.so 351 | true 352 | 353 | 354 | 355 | 356 | library\lib\armeabi-v7a\ 357 | 1 358 | libsk4d.so 359 | true 360 | 361 | 362 | 363 | 364 | library\lib\armeabi-v7a\ 365 | 1 366 | libsk4d.so 367 | true 368 | 369 | 370 | 371 | 372 | library\lib\armeabi-v7a\ 373 | 1 374 | libsk4d.so 375 | true 376 | 377 | 378 | 379 | 380 | library\lib\arm64-v8a\ 381 | 1 382 | libsk4d.so 383 | true 384 | 385 | 386 | 387 | 388 | library\lib\arm64-v8a\ 389 | 1 390 | libsk4d.so 391 | true 392 | 393 | 394 | 395 | 396 | Contents\MacOS\ 397 | 1 398 | libsk4d.dylib 399 | true 400 | 401 | 402 | 403 | 404 | Contents\MacOS\ 405 | 1 406 | libsk4d.dylib 407 | true 408 | 409 | 410 | 411 | 412 | Contents\MacOS\ 413 | 1 414 | libsk4d.dylib 415 | true 416 | 417 | 418 | 419 | 420 | Contents\MacOS\ 421 | 1 422 | libsk4d.dylib 423 | true 424 | 425 | 426 | 427 | 428 | .\ 429 | 0 430 | sk4d.dll 431 | true 432 | 433 | 434 | 435 | 436 | .\ 437 | 0 438 | sk4d.dll 439 | true 440 | 441 | 442 | 443 | 444 | true 445 | 446 | 447 | 448 | 449 | true 450 | 451 | 452 | 453 | 454 | true 455 | 456 | 457 | 458 | 459 | library\lib\arm64-v8a\ 460 | 1 461 | libsk4d.so 462 | true 463 | 464 | 465 | 466 | 467 | library\lib\arm64-v8a\ 468 | 1 469 | libsk4d.so 470 | true 471 | 472 | 473 | 474 | 475 | library\lib\armeabi-v7a\ 476 | 1 477 | libsk4d.so 478 | true 479 | 480 | 481 | 482 | 483 | library\lib\armeabi-v7a\ 484 | 1 485 | libsk4d.so 486 | true 487 | 488 | 489 | 490 | 491 | library\lib\armeabi-v7a\ 492 | 1 493 | libsk4d.so 494 | true 495 | 496 | 497 | 498 | 499 | library\lib\armeabi-v7a\ 500 | 1 501 | libsk4d.so 502 | true 503 | 504 | 505 | 506 | 507 | Contents\MacOS\ 508 | 1 509 | libsk4d.dylib 510 | true 511 | 512 | 513 | 514 | 515 | Contents\MacOS\ 516 | 1 517 | libsk4d.dylib 518 | true 519 | 520 | 521 | 522 | 523 | Contents\MacOS\ 524 | 1 525 | libsk4d.dylib 526 | true 527 | 528 | 529 | 530 | 531 | Contents\MacOS\ 532 | 1 533 | libsk4d.dylib 534 | true 535 | 536 | 537 | 538 | 539 | .\ 540 | 0 541 | sk4d.dll 542 | true 543 | 544 | 545 | 546 | 547 | .\ 548 | 0 549 | sk4d.dll 550 | true 551 | 552 | 553 | 554 | 555 | .\ 556 | 0 557 | sk4d.dll 558 | true 559 | 560 | 561 | 562 | 563 | .\ 564 | 0 565 | sk4d.dll 566 | true 567 | 568 | 569 | 570 | 571 | 572 | StableDiffusion.exe 573 | true 574 | 575 | 576 | 577 | 578 | StableDiffusion.exe 579 | true 580 | 581 | 582 | 583 | 584 | 1 585 | 586 | 587 | Contents\MacOS 588 | 1 589 | 590 | 591 | 0 592 | 593 | 594 | 595 | 596 | classes 597 | 64 598 | 599 | 600 | classes 601 | 64 602 | 603 | 604 | 605 | 606 | res\xml 607 | 1 608 | 609 | 610 | res\xml 611 | 1 612 | 613 | 614 | 615 | 616 | library\lib\armeabi-v7a 617 | 1 618 | 619 | 620 | 621 | 622 | library\lib\armeabi 623 | 1 624 | 625 | 626 | library\lib\armeabi 627 | 1 628 | 629 | 630 | 631 | 632 | library\lib\armeabi-v7a 633 | 1 634 | 635 | 636 | 637 | 638 | library\lib\mips 639 | 1 640 | 641 | 642 | library\lib\mips 643 | 1 644 | 645 | 646 | 647 | 648 | library\lib\armeabi-v7a 649 | 1 650 | 651 | 652 | library\lib\arm64-v8a 653 | 1 654 | 655 | 656 | 657 | 658 | library\lib\armeabi-v7a 659 | 1 660 | 661 | 662 | 663 | 664 | res\drawable 665 | 1 666 | 667 | 668 | res\drawable 669 | 1 670 | 671 | 672 | 673 | 674 | res\values 675 | 1 676 | 677 | 678 | res\values 679 | 1 680 | 681 | 682 | 683 | 684 | res\values-v21 685 | 1 686 | 687 | 688 | res\values-v21 689 | 1 690 | 691 | 692 | 693 | 694 | res\values 695 | 1 696 | 697 | 698 | res\values 699 | 1 700 | 701 | 702 | 703 | 704 | res\drawable 705 | 1 706 | 707 | 708 | res\drawable 709 | 1 710 | 711 | 712 | 713 | 714 | res\drawable-xxhdpi 715 | 1 716 | 717 | 718 | res\drawable-xxhdpi 719 | 1 720 | 721 | 722 | 723 | 724 | res\drawable-xxxhdpi 725 | 1 726 | 727 | 728 | res\drawable-xxxhdpi 729 | 1 730 | 731 | 732 | 733 | 734 | res\drawable-ldpi 735 | 1 736 | 737 | 738 | res\drawable-ldpi 739 | 1 740 | 741 | 742 | 743 | 744 | res\drawable-mdpi 745 | 1 746 | 747 | 748 | res\drawable-mdpi 749 | 1 750 | 751 | 752 | 753 | 754 | res\drawable-hdpi 755 | 1 756 | 757 | 758 | res\drawable-hdpi 759 | 1 760 | 761 | 762 | 763 | 764 | res\drawable-xhdpi 765 | 1 766 | 767 | 768 | res\drawable-xhdpi 769 | 1 770 | 771 | 772 | 773 | 774 | res\drawable-mdpi 775 | 1 776 | 777 | 778 | res\drawable-mdpi 779 | 1 780 | 781 | 782 | 783 | 784 | res\drawable-hdpi 785 | 1 786 | 787 | 788 | res\drawable-hdpi 789 | 1 790 | 791 | 792 | 793 | 794 | res\drawable-xhdpi 795 | 1 796 | 797 | 798 | res\drawable-xhdpi 799 | 1 800 | 801 | 802 | 803 | 804 | res\drawable-xxhdpi 805 | 1 806 | 807 | 808 | res\drawable-xxhdpi 809 | 1 810 | 811 | 812 | 813 | 814 | res\drawable-xxxhdpi 815 | 1 816 | 817 | 818 | res\drawable-xxxhdpi 819 | 1 820 | 821 | 822 | 823 | 824 | res\drawable-small 825 | 1 826 | 827 | 828 | res\drawable-small 829 | 1 830 | 831 | 832 | 833 | 834 | res\drawable-normal 835 | 1 836 | 837 | 838 | res\drawable-normal 839 | 1 840 | 841 | 842 | 843 | 844 | res\drawable-large 845 | 1 846 | 847 | 848 | res\drawable-large 849 | 1 850 | 851 | 852 | 853 | 854 | res\drawable-xlarge 855 | 1 856 | 857 | 858 | res\drawable-xlarge 859 | 1 860 | 861 | 862 | 863 | 864 | res\values 865 | 1 866 | 867 | 868 | res\values 869 | 1 870 | 871 | 872 | 873 | 874 | 1 875 | 876 | 877 | Contents\MacOS 878 | 1 879 | 880 | 881 | 0 882 | 883 | 884 | 885 | 886 | Contents\MacOS 887 | 1 888 | .framework 889 | 890 | 891 | Contents\MacOS 892 | 1 893 | .framework 894 | 895 | 896 | Contents\MacOS 897 | 1 898 | .framework 899 | 900 | 901 | 0 902 | 903 | 904 | 905 | 906 | 1 907 | .dylib 908 | 909 | 910 | 1 911 | .dylib 912 | 913 | 914 | 1 915 | .dylib 916 | 917 | 918 | Contents\MacOS 919 | 1 920 | .dylib 921 | 922 | 923 | Contents\MacOS 924 | 1 925 | .dylib 926 | 927 | 928 | Contents\MacOS 929 | 1 930 | .dylib 931 | 932 | 933 | 0 934 | .dll;.bpl 935 | 936 | 937 | 938 | 939 | 1 940 | .dylib 941 | 942 | 943 | 1 944 | .dylib 945 | 946 | 947 | 1 948 | .dylib 949 | 950 | 951 | Contents\MacOS 952 | 1 953 | .dylib 954 | 955 | 956 | Contents\MacOS 957 | 1 958 | .dylib 959 | 960 | 961 | Contents\MacOS 962 | 1 963 | .dylib 964 | 965 | 966 | 0 967 | .bpl 968 | 969 | 970 | 971 | 972 | 0 973 | 974 | 975 | 0 976 | 977 | 978 | 0 979 | 980 | 981 | 0 982 | 983 | 984 | 0 985 | 986 | 987 | Contents\Resources\StartUp\ 988 | 0 989 | 990 | 991 | Contents\Resources\StartUp\ 992 | 0 993 | 994 | 995 | Contents\Resources\StartUp\ 996 | 0 997 | 998 | 999 | 0 1000 | 1001 | 1002 | 1003 | 1004 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1005 | 1 1006 | 1007 | 1008 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1009 | 1 1010 | 1011 | 1012 | 1013 | 1014 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1015 | 1 1016 | 1017 | 1018 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1019 | 1 1020 | 1021 | 1022 | 1023 | 1024 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1025 | 1 1026 | 1027 | 1028 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1029 | 1 1030 | 1031 | 1032 | 1033 | 1034 | ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 1035 | 1 1036 | 1037 | 1038 | ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 1039 | 1 1040 | 1041 | 1042 | 1043 | 1044 | ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 1045 | 1 1046 | 1047 | 1048 | ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 1049 | 1 1050 | 1051 | 1052 | 1053 | 1054 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1055 | 1 1056 | 1057 | 1058 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1059 | 1 1060 | 1061 | 1062 | 1063 | 1064 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1065 | 1 1066 | 1067 | 1068 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1069 | 1 1070 | 1071 | 1072 | 1073 | 1074 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1075 | 1 1076 | 1077 | 1078 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1079 | 1 1080 | 1081 | 1082 | 1083 | 1084 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1085 | 1 1086 | 1087 | 1088 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1089 | 1 1090 | 1091 | 1092 | 1093 | 1094 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1095 | 1 1096 | 1097 | 1098 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1099 | 1 1100 | 1101 | 1102 | 1103 | 1104 | ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 1105 | 1 1106 | 1107 | 1108 | ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 1109 | 1 1110 | 1111 | 1112 | 1113 | 1114 | ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 1115 | 1 1116 | 1117 | 1118 | ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 1119 | 1 1120 | 1121 | 1122 | 1123 | 1124 | ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 1125 | 1 1126 | 1127 | 1128 | ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 1129 | 1 1130 | 1131 | 1132 | 1133 | 1134 | ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 1135 | 1 1136 | 1137 | 1138 | ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 1139 | 1 1140 | 1141 | 1142 | 1143 | 1144 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1145 | 1 1146 | 1147 | 1148 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1149 | 1 1150 | 1151 | 1152 | 1153 | 1154 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1155 | 1 1156 | 1157 | 1158 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1159 | 1 1160 | 1161 | 1162 | 1163 | 1164 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1165 | 1 1166 | 1167 | 1168 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1169 | 1 1170 | 1171 | 1172 | 1173 | 1174 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1175 | 1 1176 | 1177 | 1178 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1179 | 1 1180 | 1181 | 1182 | 1183 | 1184 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1185 | 1 1186 | 1187 | 1188 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1189 | 1 1190 | 1191 | 1192 | 1193 | 1194 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1195 | 1 1196 | 1197 | 1198 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1199 | 1 1200 | 1201 | 1202 | 1203 | 1204 | 1 1205 | 1206 | 1207 | 1 1208 | 1209 | 1210 | 1211 | 1212 | ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF 1213 | 1 1214 | 1215 | 1216 | ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF 1217 | 1 1218 | 1219 | 1220 | ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF 1221 | 1 1222 | 1223 | 1224 | 1225 | 1226 | ..\ 1227 | 1 1228 | 1229 | 1230 | ..\ 1231 | 1 1232 | 1233 | 1234 | ..\ 1235 | 1 1236 | 1237 | 1238 | 1239 | 1240 | 1 1241 | 1242 | 1243 | 1 1244 | 1245 | 1246 | 1 1247 | 1248 | 1249 | 1250 | 1251 | ..\$(PROJECTNAME).launchscreen 1252 | 64 1253 | 1254 | 1255 | ..\$(PROJECTNAME).launchscreen 1256 | 64 1257 | 1258 | 1259 | 1260 | 1261 | 1 1262 | 1263 | 1264 | 1 1265 | 1266 | 1267 | 1 1268 | 1269 | 1270 | 1271 | 1272 | ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF 1273 | 1 1274 | 1275 | 1276 | ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF 1277 | 1 1278 | 1279 | 1280 | 1281 | 1282 | ..\ 1283 | 1 1284 | 1285 | 1286 | ..\ 1287 | 1 1288 | 1289 | 1290 | ..\ 1291 | 1 1292 | 1293 | 1294 | 1295 | 1296 | Contents 1297 | 1 1298 | 1299 | 1300 | Contents 1301 | 1 1302 | 1303 | 1304 | Contents 1305 | 1 1306 | 1307 | 1308 | 1309 | 1310 | Contents\Resources 1311 | 1 1312 | 1313 | 1314 | Contents\Resources 1315 | 1 1316 | 1317 | 1318 | Contents\Resources 1319 | 1 1320 | 1321 | 1322 | 1323 | 1324 | library\lib\armeabi-v7a 1325 | 1 1326 | 1327 | 1328 | library\lib\arm64-v8a 1329 | 1 1330 | 1331 | 1332 | 1 1333 | 1334 | 1335 | 1 1336 | 1337 | 1338 | 1 1339 | 1340 | 1341 | 1 1342 | 1343 | 1344 | Contents\MacOS 1345 | 1 1346 | 1347 | 1348 | Contents\MacOS 1349 | 1 1350 | 1351 | 1352 | Contents\MacOS 1353 | 1 1354 | 1355 | 1356 | 0 1357 | 1358 | 1359 | 1360 | 1361 | library\lib\armeabi-v7a 1362 | 1 1363 | 1364 | 1365 | 1366 | 1367 | 1 1368 | 1369 | 1370 | 1 1371 | 1372 | 1373 | 1374 | 1375 | Assets 1376 | 1 1377 | 1378 | 1379 | Assets 1380 | 1 1381 | 1382 | 1383 | 1384 | 1385 | Assets 1386 | 1 1387 | 1388 | 1389 | Assets 1390 | 1 1391 | 1392 | 1393 | 1394 | 1395 | 1396 | 1397 | 1398 | 1399 | 1400 | 1401 | 1402 | 1403 | 1404 | 1405 | 1406 | 1407 | True 1408 | True 1409 | True 1410 | True 1411 | False 1412 | False 1413 | True 1414 | True 1415 | 1416 | 1417 | 12 1418 | 1419 | 1420 | 1421 | 1422 |
1423 | -------------------------------------------------------------------------------- /Unit1.pas: -------------------------------------------------------------------------------- 1 | unit Unit1; 2 | 3 | interface 4 | 5 | uses 6 | System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants, 7 | FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs, 8 | FMX.Controls.Presentation, FMX.StdCtrls, FMX.Layouts, FMX.ListBox, 9 | FMX.ScrollBox, FMX.Memo, FMX.Effects, FireDAC.Stan.Intf, FireDAC.Stan.Option, 10 | FireDAC.Stan.Param, FireDAC.Stan.Error, FireDAC.DatS, FireDAC.Phys.Intf, 11 | FireDAC.DApt.Intf, Data.DB, FireDAC.Comp.DataSet, FireDAC.Comp.Client, 12 | FireDAC.Stan.StorageBin, System.ImageList, FMX.ImgList, FMX.BufferedLayout, 13 | FMX.Edit, FMX.Memo.Types, FMX.MultiView, Data.Bind.EngExt, Fmx.Bind.DBEngExt, 14 | System.Rtti, System.Bindings.Outputs, Fmx.Bind.Editors, Data.Bind.Components, 15 | Data.Bind.DBScope, FMX.DialogService.Async; 16 | 17 | type 18 | TMainForm = class(TForm) 19 | StoryHSB: THorzScrollBox; 20 | Layout1: TLayout; 21 | ScrollLeftButton: TButton; 22 | ScrollRightButton: TButton; 23 | MaterialOxfordBlueSB: TStyleBook; 24 | ToolBar1: TToolBar; 25 | ShadowEffect4: TShadowEffect; 26 | Label1: TLabel; 27 | FeedVSB: TVertScrollBox; 28 | FeedMT: TFDMemTable; 29 | StoryMT: TFDMemTable; 30 | Label2: TLabel; 31 | GenerateButton: TButton; 32 | ImageList1: TImageList; 33 | Layout2: TLayout; 34 | PredictionMemo: TMemo; 35 | PromptMemo: TMemo; 36 | EmptyVSBLayout: TLayout; 37 | MultiView1: TMultiView; 38 | NegativePromptMemo: TMemo; 39 | Label3: TLabel; 40 | TemplateMT: TFDMemTable; 41 | VComboBox: TComboBox; 42 | VersionMT: TFDMemTable; 43 | VersionEdit: TEdit; 44 | BindSourceDB1: TBindSourceDB; 45 | BindingsList1: TBindingsList; 46 | LinkListControlToField1: TLinkListControlToField; 47 | LinkControlToField1: TLinkControlToField; 48 | Label4: TLabel; 49 | Label5: TLabel; 50 | LinkPropertyToFieldText: TLinkPropertyToField; 51 | SaveDialog: TSaveDialog; 52 | APIKeyEdit: TEdit; 53 | APIKeyButton: TButton; 54 | SessionsCB: TComboBox; 55 | NewSessionButton: TButton; 56 | SessionsMT: TFDMemTable; 57 | BindSourceDB2: TBindSourceDB; 58 | LinkListControlToField2: TLinkListControlToField; 59 | EnhanceButton: TButton; 60 | EnhanceTimer: TTimer; 61 | EnhanceMemo: TMemo; 62 | Label6: TLabel; 63 | ImageEdit: TEdit; 64 | Layout3: TLayout; 65 | OpenButton: TButton; 66 | OpenDialog: TOpenDialog; 67 | StrengthTB: TTrackBar; 68 | StrengthLabel: TLabel; 69 | Img2ImgLayout: TLayout; 70 | Layout7: TLayout; 71 | WidthCB: TComboBox; 72 | HeightCB: TComboBox; 73 | Label16: TLabel; 74 | Label7: TLabel; 75 | SizeMT: TFDMemTable; 76 | BindSourceDB3: TBindSourceDB; 77 | LinkFillControlToField1: TLinkFillControlToField; 78 | LinkFillControlToField2: TLinkFillControlToField; 79 | procedure ScrollLeftButtonClick(Sender: TObject); 80 | procedure ScrollRightButtonClick(Sender: TObject); 81 | procedure FormCreate(Sender: TObject); 82 | procedure CameraButtonClick(Sender: TObject); 83 | procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean); 84 | procedure APIKeyButtonClick(Sender: TObject); 85 | procedure NewSessionButtonClick(Sender: TObject); 86 | procedure SessionsCBChange(Sender: TObject); 87 | procedure EnhanceButtonClick(Sender: TObject); 88 | procedure EnhanceTimerTimer(Sender: TObject); 89 | procedure OpenButtonClick(Sender: TObject); 90 | procedure StrengthTBChange(Sender: TObject); 91 | procedure VComboBoxChange(Sender: TObject); 92 | private 93 | { Private declarations } 94 | RanOnce: Boolean; 95 | public 96 | { Public declarations } 97 | FId: String; 98 | FCircle: Integer; 99 | FCard: Integer; 100 | FSessionFile: String; 101 | procedure Restore; 102 | procedure AppIdle(Sender: TObject; var Done: Boolean); 103 | procedure NewSession(ASession: String); 104 | procedure PredictionFromImageStream(AVersion, AName, ADesc: String; AMemoryStream: TMemoryStream); 105 | procedure DeleteCard(Sender: TObject); 106 | end; 107 | 108 | var 109 | MainForm: TMainForm; 110 | 111 | implementation 112 | 113 | {$R *.fmx} 114 | 115 | uses 116 | System.Threading, System.Hash, System.IOUtils, uCircle, uCard, uDM; 117 | 118 | procedure TMainForm.DeleteCard(Sender: TObject); 119 | begin 120 | TTask.Run(procedure begin 121 | TLayout(TCardFrame(Sender).Parent).Parent := nil; 122 | FreeAndNil(TLayout(TCardFrame(Sender).Parent)); 123 | end); 124 | end; 125 | 126 | procedure TMainForm.Restore; 127 | var 128 | LCard: TCardFrame; 129 | LCircle: TCircleFrame; 130 | LStream: TStream; 131 | LScene: TLayout; 132 | begin 133 | 134 | FeedMT.First; 135 | while not FeedMT.Eof do 136 | begin 137 | 138 | // With TScene Buffering 139 | LScene := TLayout.Create(Self); 140 | LCard := TCardFrame.Create(Self); 141 | LCard.Timer1.Enabled := False; 142 | LCard.ProgressBar.Visible := False; 143 | LCard.Name := 'Card'+FCard.ToString; 144 | LCard.Align := TAlignLayout.Client; 145 | LCard.DataMT.DisableControls; 146 | LCard.DataMT.Append; 147 | LCard.DataMT.CopyRecord(FeedMT); 148 | LCard.DataMT.Post; 149 | LCard.DataMT.EnableControls; 150 | LCard.Position.Y := 999999999; 151 | LCard.NameLabel.AutoSize := True; 152 | LScene.Height := LCard.Height; 153 | LCard.Parent := LScene; 154 | LScene.Align := TAlignLayout.Top; 155 | LScene.Parent := FeedVSB; 156 | 157 | Inc(FCard); 158 | 159 | FeedMT.Next; 160 | end; 161 | end; 162 | 163 | procedure TMainForm.PredictionFromImageStream(AVersion, AName, ADesc: String; AMemoryStream: TMemoryStream); 164 | begin 165 | 166 | var LMS := TMemoryStream.Create; 167 | LMS.LoadFromStream(AMemoryStream); 168 | 169 | TTask.Run(procedure begin 170 | 171 | var LUpscaleJson := '{"version": "%version%", "input": {"image":"%base64%"}}'; 172 | 173 | if AVersion='9283608cc6b7be6b65a8e44983db012355fde4132009bf99d976b2f0896856a3' then 174 | begin 175 | LUpscaleJson := LUpscaleJson.Replace('"image"','"img"'); 176 | end; 177 | 178 | DM.RestRequest1.Params[0].Value := 'Token ' + APIKeyEdit.Text; 179 | DM.RestRequest1.Params[1].Value := LUpscaleJson.Replace('%version%',AVersion).Replace('%base64%',DM.MemoryStreamToBase64(LMS)).Replace(#13#10,''); 180 | 181 | DM.RestRequest1.Execute; 182 | 183 | TThread.Synchronize(nil,procedure begin 184 | if DM.FDMemTable1.FindField('id')<>nil then 185 | begin 186 | var LId := DM.FDMemTable1.FieldByName('id').AsWideString; 187 | 188 | var LScene := TLayout.Create(Self); 189 | var LCard := TCardFrame.Create(Self); 190 | LCard.Name := 'Card'+FCard.ToString; 191 | LCard.Hint := LId; 192 | LCard.FMainFeedMT := FeedMT; 193 | LCard.Align := TAlignLayout.Client; 194 | LCard.DataMT.DisableControls; 195 | LCard.DataMT.Append; 196 | LCard.DataMT.CopyRecord(TemplateMT); 197 | LCard.DataMT.FieldByName('Name').AsString := AName; 198 | LCard.DataMT.FieldByName('Description').AsString := ADesc; 199 | // LCard.DataMT.FieldByName('Description').AsString := LOutput; 200 | LCard.DataMT.Post; 201 | LCard.DataMT.EnableControls; 202 | LCard.Position.Y := 999999999; 203 | LCard.NameLabel.AutoSize := True; 204 | LScene.Height := LCard.Height; 205 | LCard.Parent := LScene; 206 | LScene.Align := TAlignLayout.Top; 207 | LScene.Parent := FeedVSB; 208 | 209 | Inc(FCard); 210 | end; 211 | end); 212 | 213 | LMS.Free; 214 | end); 215 | end; 216 | 217 | procedure TMainForm.APIKeyButtonClick(Sender: TObject); 218 | begin 219 | APIKeyEdit.Visible := not APIKeyEdit.Visible; 220 | end; 221 | 222 | procedure TMainForm.AppIdle(Sender: TObject; var Done: Boolean); 223 | begin 224 | if not RanOnce then 225 | begin 226 | RanOnce := True; 227 | 228 | //VComboBox.ItemIndex := VComboBox.Items.IndexOf('SDXL'); 229 | 230 | var LSessionFileName := THashMD5.GetHashString(SessionsMT.FieldByName('Name').AsString); 231 | FSessionFile := TPath.Combine(TPath.GetDocumentsPath,LSessionFileName+'.fds'); 232 | if TFile.Exists(TPath.Combine(TPath.GetDocumentsPath,LSessionFileName+'.fds')) then 233 | begin 234 | FeedMT.LoadFromFile(FSessionFile); 235 | end; 236 | 237 | Restore; 238 | 239 | end; 240 | end; 241 | 242 | procedure TMainForm.CameraButtonClick(Sender: TObject); 243 | begin 244 | if APIKeyEdit.Text='' then 245 | begin 246 | ShowMessage('Please enter an API key.'); 247 | Exit; 248 | end; 249 | 250 | GenerateButton.Enabled := False; 251 | 252 | 253 | TTask.Run(procedure begin 254 | 255 | DM.RestRequest1.Params[0].Value := 'Token ' + APIKeyEdit.Text; 256 | 257 | if (VComboBox.Selected<>nil) then 258 | begin 259 | if VComboBox.Selected.Text.Contains('Img2Img') then 260 | begin 261 | var LMS := TMemoryStream.Create; 262 | if ImageEdit.Text.Substring(0,4)<>'http' then 263 | LMS.LoadFromFile(ImageEdit.Text); 264 | 265 | var LImg2ImgJson := '{"version": "%version%","input": {"prompt": "%prompt%","negative_prompt":"%nprompt%", "strength":%strength%, "image":"%base64%", "width":%width%, "height":%height%}}'; 266 | 267 | DM.RestRequest1.Params[1].Value := LImg2ImgJson.Replace('%prompt%',PromptMemo.Lines.Text) 268 | .Replace('%nprompt%',NegativePromptMemo.Lines.Text) 269 | .Replace('%version%',VersionEdit.Text) 270 | .Replace('%width%',WidthCB.Selected.Text) 271 | .Replace('%height%',HeightCB.Selected.Text) 272 | .Replace('%strength%',Format('%.2f',[StrengthTB.Value]).Replace(',','.')); 273 | 274 | 275 | if ImageEdit.Text.Substring(0,4)<>'http' then 276 | DM.RestRequest1.Params[1].Value := DM.RestRequest1.Params[1].Value.Replace('%base64%',DM.MemoryStreamToBase64(LMS)).Replace(#13#10,'') 277 | else 278 | DM.RestRequest1.Params[1].Value := DM.RestRequest1.Params[1].Value.Replace('%base64%',ImageEdit.Text); 279 | 280 | LMS.Free; 281 | end 282 | else 283 | begin 284 | DM.RestRequest1.Params[1].Value := PredictionMemo.Lines.Text.Replace('%prompt%',PromptMemo.Lines.Text) 285 | .Replace('%nprompt%',NegativePromptMemo.Lines.Text) 286 | .Replace('%width%',WidthCB.Selected.Text) 287 | .Replace('%height%',HeightCB.Selected.Text) 288 | .Replace('%version%',VersionEdit.Text); 289 | end; 290 | end; 291 | 292 | DM.RestRequest1.Execute; 293 | if DM.FDMemTable1.FindField('id')<>nil then 294 | begin 295 | FId := DM.FDMemTable1.FieldByName('id').AsWideString; 296 | 297 | TThread.Synchronize(nil,procedure begin 298 | var LScene := TLayout.Create(Self); 299 | var LCard := TCardFrame.Create(Self); 300 | LCard.Name := 'Card'+FCard.ToString; 301 | LCard.Hint := FId; 302 | LCard.FMainFeedMT := FeedMT; 303 | LCard.Align := TAlignLayout.Client; 304 | LCard.DataMT.DisableControls; 305 | LCard.DataMT.Append; 306 | LCard.DataMT.CopyRecord(TemplateMT); 307 | LCard.DataMT.FieldByName('Name').AsString := VersionMT.FieldByName('Name').AsString; 308 | LCard.DataMT.FieldByName('Description').AsString := PromptMemo.Lines.Text; 309 | // LCard.DataMT.FieldByName('Description').AsString := LOutput; 310 | LCard.DataMT.Post; 311 | LCard.DataMT.EnableControls; 312 | LCard.Position.Y := 999999999; 313 | LCard.NameLabel.AutoSize := True; 314 | LScene.Height := LCard.Height; 315 | LCard.Parent := LScene; 316 | LScene.Align := TAlignLayout.Top; 317 | LScene.Parent := FeedVSB; 318 | 319 | Inc(FCard); 320 | 321 | GenerateButton.Enabled := True; 322 | end); 323 | 324 | end 325 | else 326 | begin 327 | TThread.Synchronize(nil,procedure begin 328 | ShowMessage('A valid response was not received.'); 329 | GenerateButton.Enabled := True; 330 | end); 331 | end; 332 | 333 | end); 334 | 335 | end; 336 | 337 | procedure TMainForm.EnhanceButtonClick(Sender: TObject); 338 | begin 339 | EnhanceButton.Enabled := False; 340 | DM.RestRequest3.Params[0].Value := 'Token ' + APIKeyEdit.Text; 341 | DM.RestRequest3.Params[1].Value := EnhanceMemo.Lines.Text.Replace('%prompt%',PromptMemo.Lines.Text); 342 | DM.RestRequest3.Execute; 343 | try 344 | DM.RestRequest4.Resource := DM.FDMemTable3.FieldByName('id').AsString; 345 | EnhanceTimer.Enabled := True; 346 | except 347 | ShowMessage('Enhance failed'); 348 | end; 349 | end; 350 | 351 | procedure TMainForm.EnhanceTimerTimer(Sender: TObject); 352 | begin 353 | EnhanceTimer.Enabled := False; 354 | DM.RestRequest4.Params[0].Value := 'Token ' + APIKeyEdit.Text; 355 | DM.RestRequest4.Execute; 356 | if DM.FDMemTable4.FieldByName('status').AsString='succeeded' then 357 | begin 358 | PromptMemo.Lines.Text := DM.FDMemTable4.FieldByName('output').AsString; 359 | EnhanceButton.Enabled := False; 360 | end 361 | else 362 | begin 363 | EnhanceTimer.Enabled := True; 364 | end; 365 | end; 366 | 367 | procedure TMainForm.FormCloseQuery(Sender: TObject; var CanClose: Boolean); 368 | begin 369 | FeedMT.SaveToFile(FSessionFile); 370 | CanClose := True; 371 | end; 372 | 373 | procedure TMainForm.FormCreate(Sender: TObject); 374 | begin 375 | if APIKeyEdit.Text<>'' then 376 | APIKeyEdit.Visible := False; 377 | 378 | if TFile.Exists(TPath.Combine(TPath.GetDocumentsPath,'sd_sessions.fds')) then 379 | SessionsMT.LoadFromFile(TPath.Combine(TPath.GetDocumentsPath,'sd_sessions.fds')); 380 | 381 | WidthCB.ItemIndex := 4; 382 | HeightCB.ItemIndex := 6; 383 | 384 | Application.OnIdle := AppIdle; 385 | end; 386 | 387 | procedure TMainForm.NewSession(ASession: String); 388 | begin 389 | FeedMT.SaveToFile(FSessionFile); 390 | FeedMT.EmptyDataSet; 391 | 392 | EmptyVSBLayout.Parent := MainForm; 393 | FeedVSB.Content.DeleteChildren; 394 | EmptyVSBLayout.Parent := FeedVSB; 395 | 396 | FSessionFile := TPath.Combine(TPath.GetDocumentsPath,THashMD5.GetHashString(ASession)+'.fds'); 397 | FeedMT.SaveToFile(FSessionFile); 398 | SessionsMT.AppendRecord([ASession]); 399 | SessionsMT.SaveToFile(TPath.Combine(TPath.GetDocumentsPath,'sd_sessions.fds')); 400 | end; 401 | 402 | procedure TMainForm.NewSessionButtonClick(Sender: TObject); 403 | begin 404 | TDialogServiceAsync.InputQuery('Enter a new session name', ['Text:'], [''], 405 | procedure(const AResult: TModalResult; const AValues: array of string) 406 | begin 407 | case AResult of 408 | mrOk: begin 409 | var AValue := AValues[0]; 410 | TThread.Synchronize(nil,procedure begin 411 | NewSession(AValue); 412 | end); 413 | end; 414 | end; 415 | end); 416 | end; 417 | 418 | procedure TMainForm.OpenButtonClick(Sender: TObject); 419 | begin 420 | if OpenDialog.Execute then 421 | begin 422 | ImageEdit.Text := OpenDialog.FileName; 423 | 424 | end; 425 | end; 426 | 427 | procedure TMainForm.ScrollLeftButtonClick(Sender: TObject); 428 | begin 429 | StoryHSB.ScrollBy(Trunc(StoryHSB.Height*0.8), 0); 430 | end; 431 | 432 | procedure TMainForm.ScrollRightButtonClick(Sender: TObject); 433 | begin 434 | StoryHSB.ScrollBy(-1*Trunc(StoryHSB.Height*0.8), 0); 435 | end; 436 | 437 | procedure TMainForm.SessionsCBChange(Sender: TObject); 438 | begin 439 | if RanOnce = True then 440 | begin 441 | FeedMT.SaveToFile(FSessionFile); 442 | FeedMT.EmptyDataSet; 443 | 444 | EmptyVSBLayout.Parent := MainForm; 445 | FeedVSB.Content.DeleteChildren; 446 | EmptyVSBLayout.Parent := FeedVSB; 447 | 448 | var LLoadSessionFile := THashMD5.GetHashString(SessionsCB.Selected.Text); 449 | FSessionFile := TPath.Combine(TPath.GetDocumentsPath,LLoadSessionFile+'.fds'); 450 | if TFile.Exists(TPath.Combine(TPath.GetDocumentsPath,LLoadSessionFile+'.fds')) then 451 | begin 452 | FeedMT.LoadFromFile(FSessionFile); 453 | end; 454 | 455 | Restore; 456 | end; 457 | end; 458 | 459 | procedure TMainForm.StrengthTBChange(Sender: TObject); 460 | begin 461 | StrengthLabel.Text := 'Strength: ' + FloatToStr(StrengthTB.Value); 462 | end; 463 | 464 | procedure TMainForm.VComboBoxChange(Sender: TObject); 465 | begin 466 | if (VComboBox.Selected<>nil) then 467 | begin 468 | if VComboBox.Selected.Text.Contains('Img2Img') OR VComboBox.Selected.Text.Contains('SDXL') then 469 | begin 470 | Img2ImgLayout.Visible := True; 471 | end 472 | else 473 | begin 474 | Img2ImgLayout.Visible := False; 475 | end; 476 | end; 477 | end; 478 | 479 | end. 480 | -------------------------------------------------------------------------------- /Unit1.vlb: -------------------------------------------------------------------------------- 1 | [Layout1] 2 | Coordinates=157,390,53,33 3 | 4 | [Layout2] 5 | Coordinates=87,390,53,33 6 | 7 | [ToolBar1] 8 | Coordinates=10,390,58,33 9 | 10 | [Label2] 11 | Coordinates=476,10,46,51 12 | 13 | [Label3] 14 | Coordinates=126,254,46,51 15 | 16 | [MaterialOxfordBlueSB] 17 | Coordinates=347,243,123,33 18 | 19 | [PromptMemo] 20 | Coordinates=189,254,80,51 21 | 22 | [FeedMT] 23 | Coordinates=106,10,64,195 24 | 25 | [Label1] 26 | Coordinates=290,254,46,51 27 | Visible=True 28 | 29 | [ImageList1] 30 | Coordinates=347,298,68,33 31 | 32 | [FeedVSB] 33 | Coordinates=517,322,59,33 34 | 35 | [NegativePromptMemo] 36 | Coordinates=10,322,123,51 37 | 38 | [ScrollRightButton] 39 | Coordinates=460,254,102,51 40 | 41 | [PredictionMemo] 42 | Coordinates=162,322,94,51 43 | 44 | [StoryMT] 45 | Coordinates=192,10,64,123 46 | 47 | [ScrollLeftButton] 48 | Coordinates=10,254,95,51 49 | 50 | [StoryHSB] 51 | Coordinates=366,322,62,33 52 | 53 | [ShadowEffect4] 54 | Coordinates=527,1,88,33 55 | 56 | [MultiView1] 57 | Coordinates=279,322,67,33 58 | 59 | [VersionMT] 60 | Coordinates=389,10,66,33 61 | Visible=False 62 | 63 | [VComboBox] 64 | Coordinates=700,10,84,123 65 | Visible=True 66 | 67 | [TemplateMT] 68 | Coordinates=10,10,74,195 69 | 70 | [] 71 | Coordinates=527,56,91,36 72 | 73 | [BindSourceDB1] 74 | Coordinates=310,30,92,123 75 | 76 | [BindingsList1] 77 | Coordinates=318,175,82,33 78 | 79 | [VersionEdit] 80 | Coordinates=539,10,71,51 81 | 82 | [Label4] 83 | Coordinates=318,377,46,51 84 | 85 | [Label5] 86 | Coordinates=220,175,46,51 87 | 88 | [GenerateButton] 89 | Coordinates=353,254,92,51 90 | 91 | [DM.RESTResponse2] 92 | Coordinates=384,374,115,303 93 | 94 | [SaveDialog] 95 | Coordinates=239,411,69,33 96 | 97 | [DM.RESTResponse1] 98 | Coordinates=401,696,115,303 99 | 100 | [DM.FDMemTable1] 101 | Coordinates=151,461,103,285 102 | 103 | [APIKeyEdit] 104 | Coordinates=538,80,69,51 105 | 106 | [DM.RESTRequest1] 107 | Coordinates=653,182,261,123 108 | 109 | [SessionsMT] 110 | Coordinates=1106,390,74,33 111 | Visible=True 112 | 113 | [DM.RESTClient1] 114 | Coordinates=537,182,95,69 115 | 116 | [DM.RESTRequest2] 117 | Coordinates=600,324,107,105 118 | 119 | [DM.FDMemTable2] 120 | Coordinates=260,461,103,285 121 | 122 | [DM.RESTClient2] 123 | Coordinates=537,516,95,69 124 | 125 | [APIKeyButton] 126 | Coordinates=62,461,83,51 127 | 128 | [BindSourceDB2] 129 | Coordinates=1022,380,92,87 130 | 131 | [SessionsCB] 132 | Coordinates=508,374,84,123 133 | Visible=True 134 | 135 | [NewSessionButton] 136 | Coordinates=508,604,108,51 137 | 138 | [EmptyVSBLayout] 139 | Coordinates=447,322,100,33 140 | 141 | [OpenButton] 142 | Coordinates=106,224,73,51 143 | 144 | [ImageEdit] 145 | Coordinates=384,444,63,51 146 | 147 | [StrengthTB] 148 | Coordinates=384,374,70,51 149 | 150 | [Layout3] 151 | Coordinates=508,220,53,33 152 | 153 | [OpenDialog] 154 | Coordinates=585,220,72,33 155 | 156 | [EnhanceButton] 157 | Coordinates=96,70,90,51 158 | 159 | [Img2ImgLayout] 160 | Coordinates=695,152,90,33 161 | 162 | [EnhanceMemo] 163 | Coordinates=0,0,87,51 164 | 165 | [StrengthLabel] 166 | Coordinates=508,150,83,51 167 | 168 | [EnhanceTimer] 169 | Coordinates=695,204,85,33 170 | 171 | [Label6] 172 | Coordinates=220,461,46,51 173 | 174 | [Layout7] 175 | Coordinates=449,482,53,33 176 | 177 | [Label16] 178 | Coordinates=161,461,52,51 179 | 180 | [SizeMT] 181 | Coordinates=180,0,49,33 182 | Visible=False 183 | 184 | [WidthCB] 185 | Coordinates=20,0,84,123 186 | Visible=True 187 | 188 | [HeightCB] 189 | Coordinates=260,40,84,123 190 | 191 | [Label7] 192 | Coordinates=13,461,46,51 193 | 194 | [BindSourceDB3] 195 | Coordinates=180,0,92,105 196 | 197 | -------------------------------------------------------------------------------- /screenshot.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FMXExpress/Stable-Diffusion-Desktop-Client/df5d56de4daca20a513c0240fdc6ae9c939b236d/screenshot.jpg -------------------------------------------------------------------------------- /uCard.fmx: -------------------------------------------------------------------------------- 1 | object CardFrame: TCardFrame 2 | Size.Width = 648.000000000000000000 3 | Size.Height = 727.000000000000000000 4 | Size.PlatformDefault = False 5 | OnResize = FrameResize 6 | object Layout1: TLayout 7 | Align = Top 8 | Position.X = 50.000000000000000000 9 | Size.Width = 598.000000000000000000 10 | Size.Height = 41.000000000000000000 11 | Size.PlatformDefault = False 12 | TabOrder = 0 13 | object MenuButton: TButton 14 | Align = Right 15 | PopupMenu = UtilsMenu 16 | Position.X = 554.000000000000000000 17 | Size.Width = 44.000000000000000000 18 | Size.Height = 41.000000000000000000 19 | Size.PlatformDefault = False 20 | StyleLookup = 'ellipseseditbutton' 21 | TabOrder = 0 22 | end 23 | object NameLabel: TLabel 24 | Align = Left 25 | StyledSettings = [Family, Size, FontColor] 26 | HitTest = True 27 | Margins.Left = 3.000000000000000000 28 | Position.X = 3.000000000000000000 29 | Size.Width = 200.000000000000000000 30 | Size.Height = 41.000000000000000000 31 | Size.PlatformDefault = False 32 | TextSettings.Font.StyleExt = {00070000000000000004000000} 33 | TextSettings.WordWrap = False 34 | TabOrder = 1 35 | OnClick = ProfileCircleClick 36 | end 37 | object FollowButton: TButton 38 | Align = Left 39 | Position.X = 203.000000000000000000 40 | Size.Width = 64.000000000000000000 41 | Size.Height = 41.000000000000000000 42 | Size.PlatformDefault = False 43 | StyleLookup = 'donetoolbutton' 44 | TabOrder = 3 45 | Text = 'follow' 46 | Visible = False 47 | OnClick = FollowButtonClick 48 | end 49 | end 50 | object Layout2: TLayout 51 | Align = Top 52 | Margins.Left = 3.000000000000000000 53 | Margins.Top = 3.000000000000000000 54 | Margins.Right = 3.000000000000000000 55 | Margins.Bottom = 3.000000000000000000 56 | Position.X = 53.000000000000000000 57 | Position.Y = 556.000000000000000000 58 | Size.Width = 592.000000000000000000 59 | Size.Height = 44.000000000000000000 60 | Size.PlatformDefault = False 61 | TabOrder = 1 62 | object Layout3: TLayout 63 | Align = MostLeft 64 | Size.Width = 89.000000000000000000 65 | Size.Height = 44.000000000000000000 66 | Size.PlatformDefault = False 67 | Visible = False 68 | TabOrder = 0 69 | object LoveButton: TButton 70 | Align = MostLeft 71 | Size.Width = 44.000000000000000000 72 | Size.Height = 44.000000000000000000 73 | Size.PlatformDefault = False 74 | StyleLookup = 'toolbutton' 75 | TabOrder = 2 76 | OnClick = LoveButtonClick 77 | object Glyph1: TGlyph 78 | Margins.Left = 3.000000000000000000 79 | Margins.Top = 3.000000000000000000 80 | Margins.Right = 3.000000000000000000 81 | Margins.Bottom = 3.000000000000000000 82 | Align = Client 83 | Opacity = 0.500000000000000000 84 | Size.Width = 38.000000000000000000 85 | Size.Height = 38.000000000000000000 86 | Size.PlatformDefault = False 87 | ImageIndex = 0 88 | Images = MainForm.ImageList1 89 | end 90 | end 91 | object CommentButton: TButton 92 | Align = Left 93 | Position.X = 44.000000000000000000 94 | Size.Width = 44.000000000000000000 95 | Size.Height = 44.000000000000000000 96 | Size.PlatformDefault = False 97 | StyleLookup = 'toolbutton' 98 | TabOrder = 1 99 | OnClick = CommentButtonClick 100 | object Glyph2: TGlyph 101 | Margins.Left = 3.000000000000000000 102 | Margins.Top = 3.000000000000000000 103 | Margins.Right = 3.000000000000000000 104 | Margins.Bottom = 3.000000000000000000 105 | Align = Client 106 | Opacity = 0.500000000000000000 107 | Size.Width = 38.000000000000000000 108 | Size.Height = 38.000000000000000000 109 | Size.PlatformDefault = False 110 | ImageIndex = 1 111 | Images = MainForm.ImageList1 112 | end 113 | end 114 | end 115 | object DownloadButton: TButton 116 | Align = Right 117 | Hint = 'Save To File' 118 | Opacity = 0.500000000000000000 119 | Position.X = 548.000000000000000000 120 | Size.Width = 44.000000000000000000 121 | Size.Height = 44.000000000000000000 122 | Size.PlatformDefault = False 123 | StyleLookup = 'organizetoolbutton' 124 | TabOrder = 8 125 | OnClick = DownloadButtonClick 126 | end 127 | object GoButton: TButton 128 | Align = Left 129 | Size.Width = 44.000000000000000000 130 | Size.Height = 44.000000000000000000 131 | Size.PlatformDefault = False 132 | StyleLookup = 'toolbutton' 133 | TabOrder = 1 134 | Visible = False 135 | OnClick = GoButtonClick 136 | object Glyph3: TGlyph 137 | Margins.Left = 3.000000000000000000 138 | Margins.Top = 3.000000000000000000 139 | Margins.Right = 3.000000000000000000 140 | Margins.Bottom = 3.000000000000000000 141 | Align = Client 142 | Opacity = 0.500000000000000000 143 | Size.Width = 38.000000000000000000 144 | Size.Height = 38.000000000000000000 145 | Size.PlatformDefault = False 146 | ImageIndex = 2 147 | Images = MainForm.ImageList1 148 | end 149 | end 150 | object EditPromptButton: TButton 151 | Align = Left 152 | Hint = 'Edit Prompt' 153 | Opacity = 0.500000000000000000 154 | Size.Width = 44.000000000000000000 155 | Size.Height = 44.000000000000000000 156 | Size.PlatformDefault = False 157 | StyleLookup = 'composetoolbutton' 158 | TabOrder = 6 159 | OnClick = EditPromptButtonClick 160 | end 161 | object CopyPromptButton: TButton 162 | Align = Left 163 | Hint = 'Copy Prompt' 164 | Opacity = 0.500000000000000000 165 | Position.X = 44.000000000000000000 166 | Size.Width = 44.000000000000000000 167 | Size.Height = 44.000000000000000000 168 | Size.PlatformDefault = False 169 | StyleLookup = 'actiontoolbutton' 170 | TabOrder = 5 171 | OnClick = CopyPromptButtonClick 172 | end 173 | object CopyImageButton: TButton 174 | Align = Left 175 | Hint = 'Copy as TImage Component' 176 | Opacity = 0.500000000000000000 177 | Position.X = 132.000000000000000000 178 | Size.Width = 44.000000000000000000 179 | Size.Height = 44.000000000000000000 180 | Size.PlatformDefault = False 181 | StyleLookup = 'forwardtoolbutton' 182 | TabOrder = 4 183 | OnClick = CopyImageButtonClick 184 | end 185 | object UpscaleButton: TButton 186 | Align = Left 187 | Hint = 'Upscaling (right-click for more)' 188 | Opacity = 0.500000000000000000 189 | PopupMenu = UpscaleMenu 190 | Position.X = 176.000000000000000000 191 | Size.Width = 44.000000000000000000 192 | Size.Height = 44.000000000000000000 193 | Size.PlatformDefault = False 194 | StyleLookup = 'additembutton' 195 | TabOrder = 2 196 | OnClick = UpscaleButtonClick 197 | end 198 | object CopyBitmapButton: TButton 199 | Align = Left 200 | Hint = 'Copy as Bitmap' 201 | Opacity = 0.500000000000000000 202 | Position.X = 88.000000000000000000 203 | Size.Width = 44.000000000000000000 204 | Size.Height = 44.000000000000000000 205 | Size.PlatformDefault = False 206 | StyleLookup = 'escapetoolbutton' 207 | TabOrder = 3 208 | OnClick = CopyBitmapButtonClick 209 | end 210 | object SendImg2ImgButton: TButton 211 | Align = Left 212 | Hint = 'Image 2 Image' 213 | Opacity = 0.500000000000000000 214 | Position.X = 220.000000000000000000 215 | Size.Width = 44.000000000000000000 216 | Size.Height = 44.000000000000000000 217 | Size.PlatformDefault = False 218 | StyleLookup = 'nexttoolbutton' 219 | TabOrder = 7 220 | OnClick = SendImg2ImgButtonClick 221 | end 222 | end 223 | object DescLabel: TLabel 224 | Align = Top 225 | AutoSize = True 226 | StyledSettings = [Family, Size, FontColor] 227 | Margins.Left = 6.000000000000000000 228 | Margins.Top = 6.000000000000000000 229 | Margins.Right = 6.000000000000000000 230 | Margins.Bottom = 6.000000000000000000 231 | Position.X = 56.000000000000000000 232 | Position.Y = 609.000000000000000000 233 | Size.Width = 586.000000000000000000 234 | Size.Height = 16.000000000000000000 235 | Size.PlatformDefault = False 236 | TextSettings.Font.StyleExt = {00070000000000000004000000} 237 | TabOrder = 4 238 | end 239 | object TimeLabel: TLabel 240 | Align = Top 241 | AutoSize = True 242 | StyledSettings = [Family] 243 | Margins.Left = 6.000000000000000000 244 | Margins.Top = 3.000000000000000000 245 | Margins.Right = 6.000000000000000000 246 | Margins.Bottom = 3.000000000000000000 247 | Position.X = 56.000000000000000000 248 | Position.Y = 634.000000000000000000 249 | Size.Width = 586.000000000000000000 250 | Size.Height = 14.000000000000000000 251 | Size.PlatformDefault = False 252 | TextSettings.Font.Size = 10.000000000000000000 253 | TextSettings.Font.StyleExt = {00070000000000000004000000} 254 | TextSettings.FontColor = claDimgray 255 | Text = 'Created at ' 256 | TabOrder = 3 257 | end 258 | object Layout4: TLayout 259 | Align = MostLeft 260 | Size.Width = 50.000000000000000000 261 | Size.Height = 727.000000000000000000 262 | Size.PlatformDefault = False 263 | TabOrder = 15 264 | object Line1: TLine 265 | Align = Contents 266 | LineType = Left 267 | Margins.Left = 25.000000000000000000 268 | Size.Width = 25.000000000000000000 269 | Size.Height = 727.000000000000000000 270 | Size.PlatformDefault = False 271 | Stroke.Color = x37FFFFFF 272 | Stroke.Thickness = 2.000000000000000000 273 | end 274 | object ProfileCircle: TCircle 275 | Align = Top 276 | Fill.Bitmap.WrapMode = TileStretch 277 | Fill.Kind = Bitmap 278 | Margins.Left = 3.000000000000000000 279 | Margins.Top = 13.000000000000000000 280 | Margins.Right = 3.000000000000000000 281 | Margins.Bottom = 3.000000000000000000 282 | Position.X = 3.000000000000000000 283 | Position.Y = 13.000000000000000000 284 | Size.Width = 44.000000000000000000 285 | Size.Height = 38.000000000000000000 286 | Size.PlatformDefault = False 287 | Stroke.Kind = None 288 | OnClick = ProfileCircleClick 289 | end 290 | end 291 | object FeedImage: TImage 292 | MultiResBitmap = < 293 | item 294 | end> 295 | Align = Top 296 | HitTest = False 297 | Position.X = 50.000000000000000000 298 | Position.Y = 41.000000000000000000 299 | Size.Width = 598.000000000000000000 300 | Size.Height = 512.000000000000000000 301 | Size.PlatformDefault = False 302 | OnDblClick = FeedImageDblClick 303 | object ProgressBar: TProgressBar 304 | Align = Center 305 | Orientation = Horizontal 306 | end 307 | end 308 | object Timer1: TTimer 309 | OnTimer = Timer1Timer 310 | Left = 168 311 | Top = 337 312 | end 313 | object Timer2: TTimer 314 | Interval = 50 315 | OnTimer = Timer2Timer 316 | Left = 242 317 | Top = 361 318 | end 319 | object UpscaleMenu: TPopupMenu 320 | Left = 362 321 | Top = 449 322 | object CodeFormerMI: TMenuItem 323 | Text = 'Codeformer (Facefix)' 324 | OnClick = CodeFormerMIClick 325 | end 326 | object RealESRGANMI: TMenuItem 327 | Text = 'Real-ESRGAN' 328 | OnClick = RealESRGANMIClick 329 | end 330 | object Swin2SRMI: TMenuItem 331 | Text = 'Swin2SR' 332 | OnClick = Swin2SRMIClick 333 | end 334 | object GFPGANMI: TMenuItem 335 | Text = 'GFPGAN (Facefix)' 336 | OnClick = GFPGANMIClick 337 | end 338 | object SwinirMI: TMenuItem 339 | Text = 'Swinir' 340 | OnClick = SwinirMIClick 341 | end 342 | object RundallesrMI: TMenuItem 343 | Text = 'Rundalle-sr' 344 | OnClick = RundallesrMIClick 345 | end 346 | object EsrganMI: TMenuItem 347 | Text = 'Esrgan' 348 | OnClick = EsrganMIClick 349 | end 350 | end 351 | object UtilsMenu: TPopupMenu 352 | Left = 442 353 | Top = 385 354 | object DeleteMI: TMenuItem 355 | Text = 'Delete' 356 | OnClick = DeleteMIClick 357 | end 358 | end 359 | object DataMT: TFDMemTable 360 | Active = True 361 | FieldDefs = < 362 | item 363 | Name = 'Id' 364 | DataType = ftInteger 365 | end 366 | item 367 | Name = 'ProfileImage' 368 | DataType = ftBlob 369 | end 370 | item 371 | Name = 'Name' 372 | DataType = ftString 373 | Size = 56 374 | end 375 | item 376 | Name = 'Description' 377 | DataType = ftString 378 | Size = 512 379 | end 380 | item 381 | Name = 'Likes' 382 | DataType = ftInteger 383 | end 384 | item 385 | Name = 'Comments' 386 | DataType = ftInteger 387 | end 388 | item 389 | Name = 'Posted' 390 | DataType = ftDateTime 391 | end 392 | item 393 | Name = 'Image' 394 | DataType = ftBlob 395 | end> 396 | IndexDefs = <> 397 | FetchOptions.AssignedValues = [evMode] 398 | FetchOptions.Mode = fmAll 399 | ResourceOptions.AssignedValues = [rvSilentMode] 400 | ResourceOptions.SilentMode = True 401 | UpdateOptions.AssignedValues = [uvCheckRequired, uvAutoCommitUpdates] 402 | UpdateOptions.CheckRequired = False 403 | UpdateOptions.AutoCommitUpdates = True 404 | StoreDefs = True 405 | Left = 160 406 | Top = 80 407 | end 408 | object BindSourceDB1: TBindSourceDB 409 | DataSet = DataMT 410 | ScopeMappings = <> 411 | Left = 160 412 | Top = 264 413 | end 414 | object BindingsList1: TBindingsList 415 | Methods = <> 416 | OutputConverters = <> 417 | Left = 116 418 | Top = 157 419 | object LinkPropertyToFieldFillBitmapBitmap: TLinkPropertyToField 420 | Category = 'Quick Bindings' 421 | DataSource = BindSourceDB1 422 | FieldName = 'ProfileImage' 423 | Component = ProfileCircle 424 | ComponentProperty = 'Fill.Bitmap.Bitmap' 425 | end 426 | object LinkPropertyToFieldText: TLinkPropertyToField 427 | Category = 'Quick Bindings' 428 | DataSource = BindSourceDB1 429 | FieldName = 'Name' 430 | Component = NameLabel 431 | ComponentProperty = 'Text' 432 | end 433 | object LinkPropertyToFieldText4: TLinkPropertyToField 434 | Category = 'Quick Bindings' 435 | DataSource = BindSourceDB1 436 | FieldName = 'Posted' 437 | Component = TimeLabel 438 | CustomFormat = #39'Created at '#39'+Self.Owner.FieldByName('#39'Posted'#39').Text' 439 | ComponentProperty = 'Text' 440 | end 441 | object LinkPropertyToFieldText5: TLinkPropertyToField 442 | Category = 'Quick Bindings' 443 | DataSource = BindSourceDB1 444 | FieldName = 'Description' 445 | Component = DescLabel 446 | CustomFormat = 'Self.Owner.FieldByName('#39'Description'#39').Text' 447 | ComponentProperty = 'Text' 448 | end 449 | object LinkPropertyToFieldBitmap: TLinkPropertyToField 450 | Category = 'Quick Bindings' 451 | DataSource = BindSourceDB1 452 | FieldName = 'Image' 453 | Component = FeedImage 454 | ComponentProperty = 'Bitmap' 455 | end 456 | end 457 | object RESTRequest2: TRESTRequest 458 | AssignedValues = [rvConnectTimeout, rvReadTimeout] 459 | Client = RESTClient2 460 | Params = < 461 | item 462 | Kind = pkHTTPHEADER 463 | Name = 'Authorization' 464 | Options = [poDoNotEncode] 465 | Value = 'Token %api_key%' 466 | end> 467 | Resource = 'cqdlci7y4zbc3fnrhtctvsbucq' 468 | Response = RESTResponse2 469 | SynchronizedEvents = False 470 | Left = 224 471 | Top = 176 472 | end 473 | object FDMemTable2: TFDMemTable 474 | Active = True 475 | FieldDefs = < 476 | item 477 | Name = 'completed_at' 478 | DataType = ftDateTime 479 | end 480 | item 481 | Name = 'created_at' 482 | DataType = ftDateTime 483 | end 484 | item 485 | Name = 'error' 486 | DataType = ftWideString 487 | Size = 255 488 | end 489 | item 490 | Name = 'id' 491 | DataType = ftWideString 492 | Size = 26 493 | end 494 | item 495 | Name = 'input' 496 | DataType = ftWideString 497 | Size = 255 498 | end 499 | item 500 | Name = 'logs' 501 | DataType = ftWideString 502 | Size = 902 503 | end 504 | item 505 | Name = 'metrics' 506 | DataType = ftWideString 507 | Size = 255 508 | end 509 | item 510 | Name = 'output' 511 | DataType = ftWideString 512 | Size = 255 513 | end 514 | item 515 | Name = 'started_at' 516 | DataType = ftDateTime 517 | end 518 | item 519 | Name = 'status' 520 | DataType = ftWideString 521 | Size = 9 522 | end 523 | item 524 | Name = 'urls' 525 | DataType = ftWideString 526 | Size = 255 527 | end 528 | item 529 | Name = 'version' 530 | DataType = ftWideString 531 | Size = 64 532 | end 533 | item 534 | Name = 'webhook_completed' 535 | DataType = ftWideString 536 | Size = 255 537 | end> 538 | IndexDefs = <> 539 | FetchOptions.AssignedValues = [evMode] 540 | FetchOptions.Mode = fmAll 541 | ResourceOptions.AssignedValues = [rvSilentMode] 542 | ResourceOptions.SilentMode = True 543 | UpdateOptions.AssignedValues = [uvUpdateChngFields, uvUpdateMode, uvLockMode, uvLockPoint, uvLockWait, uvRefreshMode, uvFetchGeneratorsPoint, uvCheckRequired, uvCheckReadOnly, uvCheckUpdatable] 544 | UpdateOptions.LockWait = True 545 | UpdateOptions.FetchGeneratorsPoint = gpNone 546 | UpdateOptions.CheckRequired = False 547 | StoreDefs = True 548 | Left = 264 549 | Top = 272 550 | end 551 | object RESTResponseDataSetAdapter2: TRESTResponseDataSetAdapter 552 | Active = True 553 | Dataset = FDMemTable2 554 | FieldDefs = <> 555 | Response = RESTResponse2 556 | TypesMode = Rich 557 | Left = 272 558 | Top = 216 559 | end 560 | object RESTResponse2: TRESTResponse 561 | ContentType = 'application/json' 562 | Left = 264 563 | Top = 128 564 | end 565 | object RESTClient2: TRESTClient 566 | Accept = 'application/json, text/plain; q=0.9, text/html;q=0.8,' 567 | AcceptCharset = 'utf-8, *;q=0.8' 568 | BaseURL = 'https://api.replicate.com/v1/predictions' 569 | ContentType = 'application/x-www-form-urlencoded' 570 | Params = <> 571 | SynchronizedEvents = False 572 | Left = 264 573 | Top = 72 574 | end 575 | object NetHTTPClient1: TNetHTTPClient 576 | UserAgent = 'Embarcadero URI Client/1.0' 577 | Left = 72 578 | Top = 329 579 | end 580 | end 581 | -------------------------------------------------------------------------------- /uCard.pas: -------------------------------------------------------------------------------- 1 | unit uCard; 2 | 3 | interface 4 | 5 | uses 6 | System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants, 7 | FMX.Types, FMX.Graphics, FMX.Controls, FMX.Forms, FMX.Dialogs, FMX.StdCtrls, 8 | FMX.Objects, FMX.Layouts, FireDAC.Stan.Intf, FireDAC.Stan.Option, 9 | FireDAC.Stan.Param, FireDAC.Stan.Error, FireDAC.DatS, FireDAC.Phys.Intf, 10 | FireDAC.DApt.Intf, Data.DB, FireDAC.Comp.DataSet, FireDAC.Comp.Client, 11 | FMX.Controls.Presentation, Data.Bind.EngExt, Fmx.Bind.DBEngExt, System.Rtti, 12 | System.Bindings.Outputs, Fmx.Bind.Editors, Data.Bind.Components, 13 | Data.Bind.DBScope, FMX.ImgList, REST.Types, REST.Client, 14 | REST.Response.Adapter, Data.Bind.ObjectScope, System.Net.URLClient, 15 | System.Net.HttpClient, System.Net.HttpClientComponent, FMX.Platform, FMX.Menus; 16 | 17 | type 18 | TCardFrame = class(TFrame) 19 | Layout1: TLayout; 20 | FeedImage: TImage; 21 | Layout2: TLayout; 22 | MenuButton: TButton; 23 | ProfileCircle: TCircle; 24 | NameLabel: TLabel; 25 | Layout3: TLayout; 26 | DownloadButton: TButton; 27 | LoveButton: TButton; 28 | CommentButton: TButton; 29 | GoButton: TButton; 30 | DescLabel: TLabel; 31 | FollowButton: TButton; 32 | TimeLabel: TLabel; 33 | DataMT: TFDMemTable; 34 | BindSourceDB1: TBindSourceDB; 35 | BindingsList1: TBindingsList; 36 | LinkPropertyToFieldFillBitmapBitmap: TLinkPropertyToField; 37 | LinkPropertyToFieldText: TLinkPropertyToField; 38 | LinkPropertyToFieldText4: TLinkPropertyToField; 39 | LinkPropertyToFieldText5: TLinkPropertyToField; 40 | LinkPropertyToFieldBitmap: TLinkPropertyToField; 41 | Glyph1: TGlyph; 42 | Glyph2: TGlyph; 43 | Glyph3: TGlyph; 44 | Timer1: TTimer; 45 | RESTRequest2: TRESTRequest; 46 | FDMemTable2: TFDMemTable; 47 | RESTResponseDataSetAdapter2: TRESTResponseDataSetAdapter; 48 | RESTResponse2: TRESTResponse; 49 | RESTClient2: TRESTClient; 50 | NetHTTPClient1: TNetHTTPClient; 51 | ProgressBar: TProgressBar; 52 | Layout4: TLayout; 53 | Line1: TLine; 54 | Timer2: TTimer; 55 | EditPromptButton: TButton; 56 | CopyPromptButton: TButton; 57 | CopyImageButton: TButton; 58 | UpscaleButton: TButton; 59 | UpscaleMenu: TPopupMenu; 60 | CodeFormerMI: TMenuItem; 61 | RealESRGANMI: TMenuItem; 62 | Swin2SRMI: TMenuItem; 63 | GFPGANMI: TMenuItem; 64 | SwinirMI: TMenuItem; 65 | RundallesrMI: TMenuItem; 66 | EsrganMI: TMenuItem; 67 | CopyBitmapButton: TButton; 68 | UtilsMenu: TPopupMenu; 69 | DeleteMI: TMenuItem; 70 | SendImg2ImgButton: TButton; 71 | procedure FollowButtonClick(Sender: TObject); 72 | procedure LoveButtonClick(Sender: TObject); 73 | procedure CommentButtonClick(Sender: TObject); 74 | procedure GoButtonClick(Sender: TObject); 75 | procedure DownloadButtonClick(Sender: TObject); 76 | procedure CommentsLabelClick(Sender: TObject); 77 | procedure ProfileCircleClick(Sender: TObject); 78 | procedure FeedImageDblClick(Sender: TObject); 79 | procedure FrameResize(Sender: TObject); 80 | procedure Timer1Timer(Sender: TObject); 81 | procedure Timer2Timer(Sender: TObject); 82 | procedure EditPromptButtonClick(Sender: TObject); 83 | procedure CopyPromptButtonClick(Sender: TObject); 84 | procedure CopyImageButtonClick(Sender: TObject); 85 | procedure CodeFormerMIClick(Sender: TObject); 86 | procedure RealESRGANMIClick(Sender: TObject); 87 | procedure Swin2SRMIClick(Sender: TObject); 88 | procedure GFPGANMIClick(Sender: TObject); 89 | procedure UpscaleButtonClick(Sender: TObject); 90 | procedure SwinirMIClick(Sender: TObject); 91 | procedure RundallesrMIClick(Sender: TObject); 92 | procedure EsrganMIClick(Sender: TObject); 93 | procedure CopyBitmapButtonClick(Sender: TObject); 94 | procedure DeleteMIClick(Sender: TObject); 95 | procedure SendImg2ImgButtonClick(Sender: TObject); 96 | private 97 | { Private declarations } 98 | public 99 | { Public declarations } 100 | FMainFeedMT: TFDMemTable; 101 | procedure UpscaleImage(AName: string; AVersion: string); 102 | end; 103 | 104 | implementation 105 | 106 | {$R *.fmx} 107 | 108 | uses 109 | Unit1, System.Threading, System.DateUtils, IdHashMessageDigest, System.IOUtils; 110 | 111 | function SaveControl(AControl: TControl): String; 112 | var 113 | LMS: TMemoryStream; 114 | LSS: TStringStream; 115 | LName: string; 116 | begin 117 | LName := AControl.Name; 118 | AControl.Name := ''; 119 | try 120 | LMS := TMemoryStream.Create; 121 | try 122 | LMS.WriteComponent(AControl); 123 | LMS.Position := 0; 124 | LSS := TStringStream.Create; 125 | try 126 | ObjectBinaryToText(LMS, LSS); 127 | Result := LSS.DataString; 128 | finally 129 | LSS.Free; 130 | end; 131 | finally 132 | LMS.Free; 133 | end; 134 | finally 135 | AControl.Name := LName; 136 | end; 137 | end; 138 | 139 | function MD5(const AString: String): String; 140 | var 141 | LHash: TIdHashMessageDigest5; 142 | begin 143 | LHash := TIdHashMessageDigest5.Create; 144 | try 145 | Result := LHash.HashStringAsHex(AString); 146 | finally 147 | LHash.Free; 148 | end; 149 | end; 150 | 151 | procedure TCardFrame.DeleteMIClick(Sender: TObject); 152 | begin 153 | MainForm.DeleteCard(Self); 154 | end; 155 | 156 | procedure TCardFrame.DownloadButtonClick(Sender: TObject); 157 | begin 158 | // Download 159 | MainForm.SaveDialog.FileName := DescLabel.Text + '.png'; 160 | if MainForm.SaveDialog.Execute then 161 | begin 162 | FeedImage.Bitmap.SaveToFile(MainForm.SaveDialog.FileName); 163 | end; 164 | end; 165 | 166 | procedure TCardFrame.EditPromptButtonClick(Sender: TObject); 167 | begin 168 | MainForm.PromptMemo.Lines.Text := DescLabel.Text; 169 | end; 170 | 171 | procedure TCardFrame.EsrganMIClick(Sender: TObject); 172 | begin 173 | UpscaleImage(TMenuItem(Sender).Text, 'c263265e04b16fda1046d1828997fc27b46610647a3348df1c72fbffbdbac912'); 174 | end; 175 | 176 | procedure TCardFrame.UpscaleButtonClick(Sender: TObject); 177 | begin 178 | CodeFormerMIClick(CodeFormerMI); 179 | end; 180 | 181 | procedure TCardFrame.UpscaleImage(AName: string; AVersion: string); 182 | begin 183 | var MS := TMemoryStream.Create; 184 | try 185 | FeedImage.Bitmap.SaveToStream(MS); 186 | MainForm.PredictionFromImageStream(AVersion,NameLabel.Text + ' - ' + AName,DescLabel.Text,MS); 187 | finally 188 | MS.Free; 189 | end; 190 | end; 191 | 192 | procedure TCardFrame.CodeFormerMIClick(Sender: TObject); 193 | begin 194 | UpscaleImage(TMenuItem(Sender).Text, '7de2ea26c616d5bf2245ad0d5e24f0ff9a6204578a5c876db53142edd9d2cd56'); 195 | end; 196 | 197 | procedure TCardFrame.CommentButtonClick(Sender: TObject); 198 | begin 199 | // Comment 200 | end; 201 | 202 | procedure TCardFrame.CommentsLabelClick(Sender: TObject); 203 | begin 204 | // View Comments 205 | end; 206 | 207 | procedure TCardFrame.CopyBitmapButtonClick(Sender: TObject); 208 | var 209 | clp: IFMXClipboardService; 210 | begin 211 | if TPlatformServices.Current.SupportsPlatformService(IFMXClipboardService) then 212 | begin 213 | clp := IFMXClipboardService(TPlatformServices.Current.GetPlatformService(IFMXClipboardService)); 214 | clp.SetClipboard(FeedImage.Bitmap); 215 | end; 216 | end; 217 | 218 | procedure TCardFrame.CopyImageButtonClick(Sender: TObject); 219 | var 220 | clp: IFMXClipboardService; 221 | begin 222 | if TPlatformServices.Current.SupportsPlatformService(IFMXClipboardService) then 223 | begin 224 | clp := IFMXClipboardService(TPlatformServices.Current.GetPlatformService(IFMXClipboardService)); 225 | clp.SetClipboard(SaveControl(FeedImage)); 226 | end; 227 | end; 228 | 229 | procedure TCardFrame.CopyPromptButtonClick(Sender: TObject); 230 | var 231 | clp: IFMXClipboardService; 232 | begin 233 | if TPlatformServices.Current.SupportsPlatformService(IFMXClipboardService) then 234 | begin 235 | clp := IFMXClipboardService(TPlatformServices.Current.GetPlatformService(IFMXClipboardService)); 236 | clp.SetClipboard(DescLabel.Text); 237 | end; 238 | end; 239 | 240 | procedure TCardFrame.FeedImageDblClick(Sender: TObject); 241 | begin 242 | // Double Tap Like 243 | LoveButtonClick(Sender); 244 | end; 245 | 246 | procedure TCardFrame.FollowButtonClick(Sender: TObject); 247 | begin 248 | // Follow 249 | end; 250 | 251 | procedure TCardFrame.FrameResize(Sender: TObject); 252 | begin 253 | FeedImage.Width := Self.Width; 254 | end; 255 | 256 | procedure TCardFrame.GFPGANMIClick(Sender: TObject); 257 | begin 258 | UpscaleImage(TMenuItem(Sender).Text, '9283608cc6b7be6b65a8e44983db012355fde4132009bf99d976b2f0896856a3'); 259 | end; 260 | 261 | procedure TCardFrame.GoButtonClick(Sender: TObject); 262 | begin 263 | // Go 264 | end; 265 | 266 | procedure TCardFrame.LoveButtonClick(Sender: TObject); 267 | begin 268 | // Like 269 | end; 270 | 271 | procedure TCardFrame.ProfileCircleClick(Sender: TObject); 272 | begin 273 | // View Profile 274 | end; 275 | 276 | procedure TCardFrame.RealESRGANMIClick(Sender: TObject); 277 | begin 278 | UpscaleImage(TMenuItem(Sender).Text, '42fed1c4974146d4d2414e2be2c5277c7fcf05fcc3a73abf41610695738c1d7b'); 279 | end; 280 | 281 | procedure TCardFrame.RundallesrMIClick(Sender: TObject); 282 | begin 283 | UpscaleImage(TMenuItem(Sender).Text, '32fdb2231d00a10d33754cc2ba794a2dfec94216579770785849ce6f149dbc69'); 284 | end; 285 | 286 | procedure TCardFrame.SendImg2ImgButtonClick(Sender: TObject); 287 | begin 288 | var LFilename := ExtractFilePath(ParamStr(0)) + 'img2img.png'; 289 | FeedImage.Bitmap.SaveToFile(LFilename); 290 | MainForm.ImageEdit.Text := LFilename; 291 | end; 292 | 293 | procedure TCardFrame.Swin2SRMIClick(Sender: TObject); 294 | begin 295 | UpscaleImage(TMenuItem(Sender).Text, 'a01b0512004918ca55d02e554914a9eca63909fa83a29ff0f115c78a7045574f'); 296 | end; 297 | 298 | procedure TCardFrame.SwinirMIClick(Sender: TObject); 299 | begin 300 | UpscaleImage(TMenuItem(Sender).Text, '660d922d33153019e8c263a3bba265de882e7f4f70396546b6c9c8f9d47a021a'); 301 | end; 302 | 303 | procedure TCardFrame.Timer1Timer(Sender: TObject); 304 | begin 305 | Timer1.Enabled := False; 306 | RESTRequest2.Params[0].Value := 'Token ' + MainForm.APIKeyEdit.Text; 307 | RESTRequest2.Resource := Self.Hint; 308 | RESTRequest2.Execute; 309 | var LStatus := FDMemTable2.FieldByName('status').AsWideString; 310 | 311 | if LStatus='succeeded' then 312 | begin 313 | var LOutput := FDMemTable2.FieldByName('output').AsWideString.Replace('["','').Replace('"]','').Replace('\/','/'); 314 | if LOutput<>'' then 315 | begin 316 | //DataMT.Edit; 317 | //DataMT.FieldByName('Description').AsString := LOutput.Replace('["','').Replace('"]','').Replace('\/','/'); 318 | //DataMT.Post; 319 | 320 | TTask.Run(procedure var LMS: TMemoryStream; begin 321 | LMS := TMemoryStream.Create; 322 | var HTTPClient := TNetHTTPClient.Create(Self); 323 | try 324 | 325 | HTTPClient.Get(LOutput,LMS); 326 | TThread.Synchronize(nil,procedure begin 327 | var LFileName := TPath.Combine(ExtractFilePath(ParamStr(0)),MD5(DataMT.FieldByName('Name').AsString + IntToStr(DateTimeToUnix(Now))) + '.png'); 328 | LMS.SaveToFile(LFileName); 329 | DataMT.Edit; 330 | TBlobField(DataMT.FieldByName('Image')).LoadFromStream(LMS); 331 | DataMT.Post; 332 | FMainFeedMT.Append; 333 | FMainFeedMT.CopyRecord(DataMT); 334 | FMainFeedMT.Post; 335 | end); 336 | finally 337 | LMS.Free; 338 | HTTPClient.Free; 339 | TThread.Synchronize(nil,procedure begin 340 | ProgressBar.Visible := False; 341 | //StatusLabel.Text := 'Status: ' + LStatus; 342 | end); 343 | end; 344 | end); 345 | end 346 | else 347 | begin 348 | DataMT.Edit; 349 | DataMT.FieldByName('Description').AsString := 'failed'; 350 | DataMT.Post; 351 | ProgressBar.Visible := False; 352 | end; 353 | 354 | Timer1.Enabled := False; 355 | end 356 | else 357 | if LStatus='failed' then 358 | begin 359 | DataMT.Edit; 360 | DataMT.FieldByName('Description').AsString := 'failed'; 361 | DataMT.Post; 362 | ProgressBar.Visible := False; 363 | 364 | Timer1.Enabled := False; 365 | end 366 | else 367 | begin 368 | if ProgressBar.Value=ProgressBar.Max then 369 | ProgressBar.Value := ProgressBar.Min 370 | else 371 | ProgressBar.Value := ProgressBar.Value+5; 372 | Timer1.Enabled := True; 373 | end; 374 | end; 375 | 376 | procedure TCardFrame.Timer2Timer(Sender: TObject); 377 | begin 378 | if ProgressBar.Visible = False then 379 | begin 380 | Timer2.Enabled := False; 381 | end 382 | else 383 | begin 384 | if ProgressBar.Value=ProgressBar.Max then 385 | ProgressBar.Value := ProgressBar.Min 386 | else 387 | ProgressBar.Value := ProgressBar.Value+5; 388 | end; 389 | end; 390 | 391 | end. 392 | -------------------------------------------------------------------------------- /uCard.vlb: -------------------------------------------------------------------------------- 1 | [Layout1] 2 | Coordinates=96,650,53,33 3 | 4 | [TimeLabel] 5 | Coordinates=368,482,65,51 6 | 7 | [GoButton] 8 | Coordinates=493,566,61,51 9 | 10 | [MenuButton] 11 | Coordinates=278,566,74,51 12 | 13 | [FollowButton] 14 | Coordinates=588,566,80,51 15 | 16 | [NameLabel] 17 | Coordinates=390,240,69,51 18 | Visible=True 19 | 20 | [CommentButton] 21 | Coordinates=10,566,95,51 22 | 23 | [LoveButton] 24 | Coordinates=388,566,71,51 25 | 26 | [Layout2] 27 | Coordinates=10,650,53,33 28 | 29 | [Layout3] 30 | Coordinates=182,650,53,33 31 | 32 | [DescLabel] 33 | Coordinates=10,246,65,51 34 | Visible=True 35 | 36 | [] 37 | Coordinates=367,128,67,51 38 | Visible=True 39 | 40 | [BindSourceDB1] 41 | Coordinates=165,147,92,213 42 | 43 | [BindingsList1] 44 | Coordinates=135,87,82,33 45 | 46 | [ProfileCircle] 47 | Coordinates=352,10,89,51 48 | Visible=True 49 | ExplicitSubNodes=Fill.Bitmap.Bitmap 50 | 51 | [FeedImage] 52 | Coordinates=480,170,68,51 53 | Visible=True 54 | 55 | [DataMT] 56 | Coordinates=10,10,51,33 57 | Visible=False 58 | 59 | [Form1.StoryMT] 60 | Coordinates=56,253,89,123 61 | 62 | [Glyph2] 63 | Coordinates=122,1,49,33 64 | 65 | [Glyph1] 66 | Coordinates=309,87,49,33 67 | 68 | [Glyph3] 69 | Coordinates=309,142,49,33 70 | 71 | [Form1.FeedMT] 72 | Coordinates=0,0,87,195 73 | 74 | [Timer1] 75 | Coordinates=106,53,48,33 76 | 77 | [FDMemTable2] 78 | Coordinates=295,636,100,285 79 | 80 | [RESTResponseDataSetAdapter2] 81 | Coordinates=479,1,174,33 82 | 83 | [RESTResponse2] 84 | Coordinates=196,721,96,303 85 | 86 | [RESTClient2] 87 | Coordinates=295,198,76,69 88 | 89 | [ProgressBar] 90 | Coordinates=295,286,76,51 91 | 92 | [NetHTTPClient1] 93 | Coordinates=147,398,92,33 94 | 95 | [RESTRequest2] 96 | Coordinates=246,414,104,105 97 | 98 | [MainForm.VersionMT] 99 | Visible=False 100 | Coordinates=18,398,119,33 101 | 102 | [DownloadButton] 103 | Coordinates=143,566,96,51 104 | 105 | [Timer2] 106 | Coordinates=24,124,48,33 107 | 108 | [Line1] 109 | Coordinates=116,285,41,33 110 | 111 | [Layout4] 112 | Coordinates=479,53,53,33 113 | 114 | [MainForm.BindSourceDB1] 115 | Coordinates=0,0,144,105 116 | 117 | [MainForm.FeedMT] 118 | Coordinates=189,266,105,195 119 | 120 | [MainForm.StoryMT] 121 | Coordinates=73,124,107,123 122 | 123 | [MainForm.TemplateMT] 124 | Coordinates=190,1,126,195 125 | 126 | [EditPromptButton] 127 | Coordinates=497,105,103,51 128 | 129 | [MainForm.SessionsMT] 130 | Visible=False 131 | 132 | [MainForm.SizeMT] 133 | Visible=False 134 | 135 | -------------------------------------------------------------------------------- /uCircle.fmx: -------------------------------------------------------------------------------- 1 | object CircleFrame: TCircleFrame 2 | Size.Width = 211.000000000000000000 3 | Size.Height = 240.000000000000000000 4 | Size.PlatformDefault = False 5 | object LineCircle: TCircle 6 | Align = Client 7 | Fill.Kind = None 8 | Margins.Left = 3.000000000000000000 9 | Margins.Top = 3.000000000000000000 10 | Margins.Right = 3.000000000000000000 11 | Margins.Bottom = 3.000000000000000000 12 | Size.Width = 205.000000000000000000 13 | Size.Height = 200.000000000000000000 14 | Size.PlatformDefault = False 15 | Stroke.Color = claBlue 16 | Stroke.Thickness = 3.000000000000000000 17 | end 18 | object ImageCircle: TCircle 19 | Align = Client 20 | Fill.Bitmap.WrapMode = TileStretch 21 | Fill.Kind = Bitmap 22 | Margins.Left = 9.000000000000000000 23 | Margins.Top = 9.000000000000000000 24 | Margins.Right = 9.000000000000000000 25 | Margins.Bottom = 9.000000000000000000 26 | Size.Width = 193.000000000000000000 27 | Size.Height = 188.000000000000000000 28 | Size.PlatformDefault = False 29 | Stroke.Kind = None 30 | end 31 | object Label1: TLabel 32 | Align = Bottom 33 | StyledSettings = [Family, Size, FontColor] 34 | Position.Y = 206.000000000000000000 35 | Size.Width = 211.000000000000000000 36 | Size.Height = 17.000000000000000000 37 | Size.PlatformDefault = False 38 | TextSettings.Font.StyleExt = {00070000000000000004000000} 39 | TextSettings.HorzAlign = Center 40 | Text = 'Label1' 41 | TabOrder = 2 42 | end 43 | object Label2: TLabel 44 | Align = MostBottom 45 | StyledSettings = [Family] 46 | Position.Y = 223.000000000000000000 47 | Size.Width = 211.000000000000000000 48 | Size.Height = 17.000000000000000000 49 | Size.PlatformDefault = False 50 | TextSettings.Font.Size = 10.000000000000000000 51 | TextSettings.Font.StyleExt = {00070000000000000004000000} 52 | TextSettings.FontColor = claDimgray 53 | TextSettings.HorzAlign = Center 54 | Text = 'Label2' 55 | TabOrder = 3 56 | end 57 | end 58 | -------------------------------------------------------------------------------- /uCircle.pas: -------------------------------------------------------------------------------- 1 | unit uCircle; 2 | 3 | interface 4 | 5 | uses 6 | System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants, 7 | FMX.Types, FMX.Graphics, FMX.Controls, FMX.Forms, FMX.Dialogs, FMX.StdCtrls, 8 | FMX.Objects, FMX.Controls.Presentation; 9 | 10 | type 11 | TCircleFrame = class(TFrame) 12 | LineCircle: TCircle; 13 | ImageCircle: TCircle; 14 | Label1: TLabel; 15 | Label2: TLabel; 16 | private 17 | { Private declarations } 18 | public 19 | { Public declarations } 20 | end; 21 | 22 | implementation 23 | 24 | {$R *.fmx} 25 | 26 | end. 27 | -------------------------------------------------------------------------------- /uDM.dfm: -------------------------------------------------------------------------------- 1 | object DM: TDM 2 | Height = 480 3 | Width = 640 4 | object RESTClient1: TRESTClient 5 | Accept = 'application/json, text/plain; q=0.9, text/html;q=0.8,' 6 | AcceptCharset = 'utf-8, *;q=0.8' 7 | BaseURL = 'https://api.replicate.com/v1/predictions' 8 | ContentType = 'application/json' 9 | Params = <> 10 | SynchronizedEvents = False 11 | Left = 160 12 | Top = 64 13 | end 14 | object RESTRequest1: TRESTRequest 15 | AssignedValues = [rvConnectTimeout, rvReadTimeout] 16 | Client = RESTClient1 17 | Method = rmPOST 18 | Params = < 19 | item 20 | Kind = pkHTTPHEADER 21 | Name = 'Authorization' 22 | Options = [poDoNotEncode] 23 | Value = 'Token %api_key%' 24 | end 25 | item 26 | Kind = pkREQUESTBODY 27 | Name = 'body743FA4081F4C440C91A2D44F7691E32F' 28 | Options = [poDoNotEncode] 29 | Value = 30 | '{"version": "%version%","input": {"prompt": "%prompt%","negative' + 31 | '_prompt":"%nprompt%"}}' 32 | ContentTypeStr = 'application/json' 33 | end> 34 | Response = RESTResponse1 35 | SynchronizedEvents = False 36 | Left = 144 37 | Top = 136 38 | end 39 | object RESTResponse1: TRESTResponse 40 | ContentType = 'application/json' 41 | Left = 256 42 | Top = 88 43 | end 44 | object RESTResponseDataSetAdapter1: TRESTResponseDataSetAdapter 45 | Active = True 46 | Dataset = FDMemTable1 47 | FieldDefs = <> 48 | Response = RESTResponse1 49 | TypesMode = Rich 50 | Left = 264 51 | Top = 168 52 | end 53 | object FDMemTable1: TFDMemTable 54 | Active = True 55 | FieldDefs = < 56 | item 57 | Name = 'completed_at' 58 | DataType = ftWideString 59 | Size = 255 60 | end 61 | item 62 | Name = 'created_at' 63 | DataType = ftDateTime 64 | end 65 | item 66 | Name = 'error' 67 | DataType = ftWideString 68 | Size = 255 69 | end 70 | item 71 | Name = 'id' 72 | DataType = ftWideString 73 | Size = 26 74 | end 75 | item 76 | Name = 'input' 77 | DataType = ftWideString 78 | Size = 255 79 | end 80 | item 81 | Name = 'logs' 82 | DataType = ftWideString 83 | Size = 255 84 | end 85 | item 86 | Name = 'metrics' 87 | DataType = ftWideString 88 | Size = 255 89 | end 90 | item 91 | Name = 'output' 92 | DataType = ftWideString 93 | Size = 255 94 | end 95 | item 96 | Name = 'started_at' 97 | DataType = ftWideString 98 | Size = 255 99 | end 100 | item 101 | Name = 'status' 102 | DataType = ftWideString 103 | Size = 8 104 | end 105 | item 106 | Name = 'urls' 107 | DataType = ftWideString 108 | Size = 255 109 | end 110 | item 111 | Name = 'version' 112 | DataType = ftWideString 113 | Size = 64 114 | end 115 | item 116 | Name = 'webhook_completed' 117 | DataType = ftWideString 118 | Size = 255 119 | end> 120 | IndexDefs = <> 121 | FetchOptions.AssignedValues = [evMode] 122 | FetchOptions.Mode = fmAll 123 | ResourceOptions.AssignedValues = [rvSilentMode] 124 | ResourceOptions.SilentMode = True 125 | UpdateOptions.AssignedValues = [uvUpdateChngFields, uvUpdateMode, uvLockMode, uvLockPoint, uvLockWait, uvRefreshMode, uvFetchGeneratorsPoint, uvCheckRequired, uvCheckReadOnly, uvCheckUpdatable] 126 | UpdateOptions.LockWait = True 127 | UpdateOptions.FetchGeneratorsPoint = gpNone 128 | UpdateOptions.CheckRequired = False 129 | StoreDefs = True 130 | Left = 272 131 | Top = 248 132 | end 133 | object RESTClient2: TRESTClient 134 | Accept = 'application/json, text/plain; q=0.9, text/html;q=0.8,' 135 | AcceptCharset = 'utf-8, *;q=0.8' 136 | BaseURL = 'https://api.replicate.com/v1/predictions' 137 | ContentType = 'application/x-www-form-urlencoded' 138 | Params = <> 139 | SynchronizedEvents = False 140 | Left = 448 141 | Top = 88 142 | end 143 | object RESTRequest2: TRESTRequest 144 | AssignedValues = [rvConnectTimeout, rvReadTimeout] 145 | Client = RESTClient2 146 | Params = < 147 | item 148 | Kind = pkHTTPHEADER 149 | Name = 'Authorization' 150 | Options = [poDoNotEncode] 151 | Value = 'Token %api_key%' 152 | end> 153 | Resource = 'cqdlci7y4zbc3fnrhtctvsbucq' 154 | Response = RESTResponse2 155 | SynchronizedEvents = False 156 | Left = 432 157 | Top = 192 158 | end 159 | object RESTResponse2: TRESTResponse 160 | ContentType = 'application/json' 161 | Left = 528 162 | Top = 144 163 | end 164 | object RESTResponseDataSetAdapter2: TRESTResponseDataSetAdapter 165 | Active = True 166 | Dataset = FDMemTable2 167 | FieldDefs = <> 168 | Response = RESTResponse2 169 | TypesMode = Rich 170 | Left = 536 171 | Top = 208 172 | end 173 | object FDMemTable2: TFDMemTable 174 | Active = True 175 | FieldDefs = < 176 | item 177 | Name = 'completed_at' 178 | DataType = ftDateTime 179 | end 180 | item 181 | Name = 'created_at' 182 | DataType = ftDateTime 183 | end 184 | item 185 | Name = 'error' 186 | DataType = ftWideString 187 | Size = 255 188 | end 189 | item 190 | Name = 'id' 191 | DataType = ftWideString 192 | Size = 26 193 | end 194 | item 195 | Name = 'input' 196 | DataType = ftWideString 197 | Size = 255 198 | end 199 | item 200 | Name = 'logs' 201 | DataType = ftWideString 202 | Size = 902 203 | end 204 | item 205 | Name = 'metrics' 206 | DataType = ftWideString 207 | Size = 255 208 | end 209 | item 210 | Name = 'output' 211 | DataType = ftWideString 212 | Size = 255 213 | end 214 | item 215 | Name = 'started_at' 216 | DataType = ftDateTime 217 | end 218 | item 219 | Name = 'status' 220 | DataType = ftWideString 221 | Size = 9 222 | end 223 | item 224 | Name = 'urls' 225 | DataType = ftWideString 226 | Size = 255 227 | end 228 | item 229 | Name = 'version' 230 | DataType = ftWideString 231 | Size = 64 232 | end 233 | item 234 | Name = 'webhook_completed' 235 | DataType = ftWideString 236 | Size = 255 237 | end> 238 | IndexDefs = <> 239 | FetchOptions.AssignedValues = [evMode] 240 | FetchOptions.Mode = fmAll 241 | ResourceOptions.AssignedValues = [rvSilentMode] 242 | ResourceOptions.SilentMode = True 243 | UpdateOptions.AssignedValues = [uvUpdateChngFields, uvUpdateMode, uvLockMode, uvLockPoint, uvLockWait, uvRefreshMode, uvFetchGeneratorsPoint, uvCheckRequired, uvCheckReadOnly, uvCheckUpdatable] 244 | UpdateOptions.LockWait = True 245 | UpdateOptions.FetchGeneratorsPoint = gpNone 246 | UpdateOptions.CheckRequired = False 247 | StoreDefs = True 248 | Left = 488 249 | Top = 288 250 | end 251 | object RESTClient3: TRESTClient 252 | BaseURL = 'https://api.replicate.com/v1/predictions' 253 | Params = <> 254 | SynchronizedEvents = False 255 | Left = 80 256 | Top = 256 257 | end 258 | object RESTRequest3: TRESTRequest 259 | AssignedValues = [rvConnectTimeout, rvReadTimeout] 260 | Client = RESTClient3 261 | Method = rmPOST 262 | Params = < 263 | item 264 | Kind = pkHTTPHEADER 265 | Name = 'Authorization' 266 | Options = [poDoNotEncode] 267 | Value = 'Token %api_key%' 268 | end 269 | item 270 | Kind = pkREQUESTBODY 271 | Name = 'body7E86320BF8944C89A4DFC53FC1BAD6FC' 272 | Value = 273 | '{"version": "d53a494f0f1f4130d39cbe574c25d267910e1fce4e7f4b34fe1' + 274 | '5f22976aed332", "input": {"prompt": "%prompt%"}}' 275 | ContentTypeStr = 'application/json' 276 | end> 277 | Response = RESTResponse3 278 | SynchronizedEvents = False 279 | Left = 88 280 | Top = 320 281 | end 282 | object RESTResponse3: TRESTResponse 283 | Left = 104 284 | Top = 368 285 | end 286 | object RESTResponseDataSetAdapter3: TRESTResponseDataSetAdapter 287 | Dataset = FDMemTable3 288 | FieldDefs = <> 289 | Response = RESTResponse3 290 | TypesMode = Rich 291 | Left = 120 292 | Top = 392 293 | end 294 | object FDMemTable3: TFDMemTable 295 | FetchOptions.AssignedValues = [evMode] 296 | FetchOptions.Mode = fmAll 297 | ResourceOptions.AssignedValues = [rvSilentMode] 298 | ResourceOptions.SilentMode = True 299 | UpdateOptions.AssignedValues = [uvUpdateChngFields, uvUpdateMode, uvLockMode, uvLockPoint, uvLockWait, uvRefreshMode, uvFetchGeneratorsPoint, uvCheckRequired, uvCheckReadOnly, uvCheckUpdatable] 300 | UpdateOptions.LockWait = True 301 | UpdateOptions.FetchGeneratorsPoint = gpNone 302 | UpdateOptions.CheckRequired = False 303 | Left = 208 304 | Top = 384 305 | end 306 | object RESTClient4: TRESTClient 307 | BaseURL = 'https://api.replicate.com/v1/predictions' 308 | Params = <> 309 | SynchronizedEvents = False 310 | Left = 296 311 | Top = 328 312 | end 313 | object RESTRequest4: TRESTRequest 314 | AssignedValues = [rvConnectTimeout, rvReadTimeout] 315 | Client = RESTClient4 316 | Params = < 317 | item 318 | Kind = pkHTTPHEADER 319 | Name = 'Authorization' 320 | Options = [poDoNotEncode] 321 | Value = 'Token %api_key%' 322 | end> 323 | Resource = '7lswsyevjzbi3otimjkwujj5e4' 324 | Response = RESTResponse4 325 | SynchronizedEvents = False 326 | Left = 288 327 | Top = 384 328 | end 329 | object RESTResponse4: TRESTResponse 330 | Left = 368 331 | Top = 352 332 | end 333 | object RESTResponseDataSetAdapter4: TRESTResponseDataSetAdapter 334 | Dataset = FDMemTable4 335 | FieldDefs = <> 336 | Response = RESTResponse4 337 | TypesMode = Rich 338 | Left = 336 339 | Top = 408 340 | end 341 | object FDMemTable4: TFDMemTable 342 | FetchOptions.AssignedValues = [evMode] 343 | FetchOptions.Mode = fmAll 344 | ResourceOptions.AssignedValues = [rvSilentMode] 345 | ResourceOptions.SilentMode = True 346 | UpdateOptions.AssignedValues = [uvUpdateChngFields, uvUpdateMode, uvLockMode, uvLockPoint, uvLockWait, uvRefreshMode, uvFetchGeneratorsPoint, uvCheckRequired, uvCheckReadOnly, uvCheckUpdatable] 347 | UpdateOptions.LockWait = True 348 | UpdateOptions.FetchGeneratorsPoint = gpNone 349 | UpdateOptions.CheckRequired = False 350 | Left = 400 351 | Top = 392 352 | end 353 | end 354 | -------------------------------------------------------------------------------- /uDM.pas: -------------------------------------------------------------------------------- 1 | unit uDM; 2 | 3 | interface 4 | 5 | uses 6 | System.SysUtils, System.Classes, REST.Types, FireDAC.Stan.Intf, 7 | FireDAC.Stan.Option, FireDAC.Stan.Param, FireDAC.Stan.Error, FireDAC.DatS, 8 | FireDAC.Phys.Intf, FireDAC.DApt.Intf, Data.DB, FireDAC.Comp.DataSet, 9 | FireDAC.Comp.Client, REST.Response.Adapter, REST.Client, Data.Bind.Components, 10 | Data.Bind.ObjectScope; 11 | 12 | type 13 | TDM = class(TDataModule) 14 | RESTClient1: TRESTClient; 15 | RESTRequest1: TRESTRequest; 16 | RESTResponse1: TRESTResponse; 17 | RESTResponseDataSetAdapter1: TRESTResponseDataSetAdapter; 18 | FDMemTable1: TFDMemTable; 19 | RESTClient2: TRESTClient; 20 | RESTRequest2: TRESTRequest; 21 | RESTResponse2: TRESTResponse; 22 | RESTResponseDataSetAdapter2: TRESTResponseDataSetAdapter; 23 | FDMemTable2: TFDMemTable; 24 | RESTClient3: TRESTClient; 25 | RESTRequest3: TRESTRequest; 26 | RESTResponse3: TRESTResponse; 27 | RESTResponseDataSetAdapter3: TRESTResponseDataSetAdapter; 28 | FDMemTable3: TFDMemTable; 29 | RESTClient4: TRESTClient; 30 | RESTRequest4: TRESTRequest; 31 | RESTResponse4: TRESTResponse; 32 | RESTResponseDataSetAdapter4: TRESTResponseDataSetAdapter; 33 | FDMemTable4: TFDMemTable; 34 | private 35 | { Private declarations } 36 | public 37 | { Public declarations } 38 | function FileToBase64(const FileName: string): string; 39 | function MemoryStreamToBase64(const MemoryStream: TMemoryStream): string; 40 | end; 41 | 42 | var 43 | DM: TDM; 44 | 45 | implementation 46 | 47 | {%CLASSGROUP 'FMX.Controls.TControl'} 48 | 49 | {$R *.dfm} 50 | 51 | uses 52 | System.NetEncoding, System.Net.Mime; 53 | 54 | 55 | function TDM.MemoryStreamToBase64(const MemoryStream: TMemoryStream): string; 56 | var 57 | OutputStringStream: TStringStream; 58 | Base64Encoder: TBase64Encoding; 59 | MimeType: string; 60 | begin 61 | MemoryStream.Position := 0; 62 | OutputStringStream := TStringStream.Create('', TEncoding.ASCII); 63 | try 64 | Base64Encoder := TBase64Encoding.Create; 65 | try 66 | Base64Encoder.Encode(MemoryStream, OutputStringStream); 67 | MimeType := 'image/png'; 68 | Result := 'data:' + MimeType + ';base64,' + OutputStringStream.DataString; 69 | finally 70 | Base64Encoder.Free; 71 | end; 72 | finally 73 | OutputStringStream.Free; 74 | end; 75 | end; 76 | 77 | function TDM.FileToBase64(const FileName: string): string; 78 | var 79 | InputStream: TFileStream; 80 | OutputStringStream: TStringStream; 81 | Base64Encoder: TBase64Encoding; 82 | MimeType: string; 83 | LKind: TMimeTypes.TKind; 84 | begin 85 | InputStream := TFileStream.Create(FileName, fmOpenRead or fmShareDenyWrite); 86 | try 87 | OutputStringStream := TStringStream.Create('', TEncoding.ASCII); 88 | try 89 | Base64Encoder := TBase64Encoding.Create; 90 | try 91 | Base64Encoder.Encode(InputStream, OutputStringStream); 92 | TMimeTypes.Default.GetFileInfo(FileName,MimeType,LKind); 93 | Result := 'data:' + MimeType + ';base64,' + OutputStringStream.DataString; 94 | finally 95 | Base64Encoder.Free; 96 | end; 97 | finally 98 | OutputStringStream.Free; 99 | end; 100 | finally 101 | InputStream.Free; 102 | end; 103 | end; 104 | 105 | end. 106 | --------------------------------------------------------------------------------