{"id":22771640,"url":"https://github.com/fmxexpress/ai-image-upscaler","last_synced_at":"2025-03-30T12:14:46.433Z","repository":{"id":265670372,"uuid":"867813595","full_name":"FMXExpress/AI-Image-Upscaler","owner":"FMXExpress","description":"AI Image Upscaler desktop GUI using FireMonkey for Python.","archived":false,"fork":false,"pushed_at":"2024-10-05T13:43:49.000Z","size":1053,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-26T20:23:05.318Z","etag":null,"topics":["firemonkey","fmx","generative-ai","python","replicate-api","upscaler"],"latest_commit_sha":null,"homepage":"https://www.fmxexpress.com/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/FMXExpress.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-04T19:16:08.000Z","updated_at":"2025-02-04T00:40:31.000Z","dependencies_parsed_at":"2024-11-30T12:32:59.274Z","dependency_job_id":"ddc66913-4037-45c9-a1ec-4625cee19b06","html_url":"https://github.com/FMXExpress/AI-Image-Upscaler","commit_stats":null,"previous_names":["fmxexpress/ai-image-upscaler"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FMXExpress%2FAI-Image-Upscaler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FMXExpress%2FAI-Image-Upscaler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FMXExpress%2FAI-Image-Upscaler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FMXExpress%2FAI-Image-Upscaler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FMXExpress","download_url":"https://codeload.github.com/FMXExpress/AI-Image-Upscaler/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246314149,"owners_count":20757463,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["firemonkey","fmx","generative-ai","python","replicate-api","upscaler"],"created_at":"2024-12-11T16:16:01.158Z","updated_at":"2025-03-30T12:14:46.416Z","avatar_url":"https://github.com/FMXExpress.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AI Image Upscaler\n AI Image Upscaler desktop GUI using FireMonkey for Python.\n\n\nThis project is a cross-platform GUI application built with [DelphiFMX for Python](https://github.com/Embarcadero/DelphiFMX4Python), providing an interface for AI-based image upscaling. The app leverages the [Replicate API](https://replicate.com/) to upscale images by adding detail and enhancing image quality. The app supports real-time status updates, running the upscaling in the background without freezing the UI.\n\n## Features\n\n- **Cross-Platform GUI**: Built using DelphiFMX for Python, the app runs on Windows, macOS, and Linux.\n- **AI-Powered Image Upscaling**: Uses the [philz1337x/clarity-upscaler](https://replicate.com/philz1337x/clarity-upscaler) model from Replicate to enhance image details.\n- **Asynchronous Processing**: The app handles image processing in the background, ensuring the UI remains responsive.\n- **Status Updates**: Displays real-time progress of the upscaling process.\n- **Image Display**: Shows both the original and upscaled images within the app.\n\n## Screenshot\n\nBelow is a screenshot of the GUI in action:\n\n![App Screenshot](./screenshot.png)\n\n## Requirements\n\n- Python 3.8 or higher\n- [DelphiFMX for Python](https://pypi.org/project/delphifmx/)\n- Replicate API key\n- [Replicate Python package](https://pypi.org/project/replicate/)\n\n## Installation\n\n1. Clone this repository:\n   ```bash\n   git clone https://github.com/yourusername/image-upscaler-fmx.git\n   cd image-upscaler-fmx\n   ```\n\n2. Install the required Python packages:\n   ```bash\n   pip install replicate delphifmx\n   ```\n\n3. Set your Replicate API key:\n   - Sign up at [Replicate](https://replicate.com/) and get your API key.\n   - Set the API key as an environment variable:\n     ```bash\n     export REPLICATE_API_TOKEN=\"your_replicate_api_key\"\n     ```\n\n4. Run the application:\n   ```bash\n   python app.py\n   ```\n\n## Usage\n\n1. Open the app and click **Select** to choose an image from your file system.\n2. The app will display the original image on the left side.\n3. Once an image is selected, it will be processed using the Replicate API. The status bar at the bottom will show real-time updates.\n4. After the upscaling is completed, the upscaled image will appear on the right side of the screen.\n\n## Code Overview\n\n### Imports\n\n```python\nimport os\nimport replicate\nimport urllib.request\nimport hashlib\nfrom delphifmx import *\nimport threading  # To handle background process without blocking the app\n```\n\n- **os**: Used for environment variables.\n- **replicate**: Connects to the [Replicate API](https://replicate.com/) for AI-based image upscaling.\n- **urllib.request**: Downloads the upscaled image.\n- **hashlib**: Ensures unique filenames for downloaded images.\n- **delphifmx**: Provides cross-platform GUI components via [DelphiFMX for Python](https://github.com/Embarcadero/DelphiFMX4Python).\n- **threading**: Runs the upscaling process in the background without locking the UI.\n\n### Core Components\n\n- **Form Layout**: The main window contains components for image upload, original image display, upscaled image display, and a status bar.\n- **Asynchronous Processing**: Upscaling runs in the background using the `Replicate API`, and the app updates the UI in real-time.\n- **Timer**: Periodically checks the status of the upscaling process and updates the status bar accordingly.\n\n### Example API Call\n\nThe app uses the Replicate model for upscaling:\n\n```python\nmodel = replicate.models.get(\"philz1337x/clarity-upscaler\")\nversion = model.versions.get(\"dfad41707589d68ecdccd1dfa600d55a208f9310748e44bfe35b4a6291453d5e\")\nself.prediction = replicate.predictions.create(\n    version=version,\n    input={\"image\": open(file_path, \"rb\")}\n)\n```\n\n## Contributing\n\n1. Fork the repository.\n2. Open a pull request.\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.\n\n## Acknowledgments\n\n- [DelphiFMX for Python](https://github.com/Embarcadero/DelphiFMX4Python)\n- [Replicate API](https://replicate.com/)\n- [philz1337x/clarity-upscaler](https://replicate.com/philz1337x/clarity-upscaler)\n\n```\n\nThis README provides an overview of the project, including instructions for installation, usage, and contributing, along with links to the necessary resources.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffmxexpress%2Fai-image-upscaler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffmxexpress%2Fai-image-upscaler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffmxexpress%2Fai-image-upscaler/lists"}