Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Jerome George committed May 3, 2023
0 parents commit 490410c
Show file tree
Hide file tree
Showing 36 changed files with 2,552 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Auto detect text files and perform LF normalization
* text=auto
44 changes: 44 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Miscellaneous
*.class
*.log
*.pyc
*.swp
.DS_Store
.atom/
.buildlog/
.history
.svn/
migrate_working_dir/

# IntelliJ related
*.iml
*.ipr
*.iws
.idea/

# The .vscode folder contains launch configuration and tasks you configure in
# VS Code which you may wish to be included in version control, so this line
# is commented out by default.
#.vscode/

# Flutter/Dart/Pub related
**/doc/api/
**/ios/Flutter/.last_build_id
.dart_tool/
.flutter-plugins
.flutter-plugins-dependencies
.packages
.pub-cache/
.pub/
/build/

# Symbolication related
app.*.symbols

# Obfuscation related
app.*.map.json

# Android Studio will place build artifacts here
/android/app/debug
/android/app/profile
/android/app/release
30 changes: 30 additions & 0 deletions .metadata
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# This file tracks properties of this Flutter project.
# Used by Flutter tool to assess capabilities and perform upgrades etc.
#
# This file should be version controlled.

version:
revision: 90c64ed42ba53a52d18f0cb3b17666c8662ed2a0
channel: stable

project_type: app

# Tracks metadata for the flutter migrate command
migration:
platforms:
- platform: root
create_revision: 90c64ed42ba53a52d18f0cb3b17666c8662ed2a0
base_revision: 90c64ed42ba53a52d18f0cb3b17666c8662ed2a0
- platform: windows
create_revision: 90c64ed42ba53a52d18f0cb3b17666c8662ed2a0
base_revision: 90c64ed42ba53a52d18f0cb3b17666c8662ed2a0

# User provided section

# List of Local paths (relative to this file) that should be
# ignored by the migrate tool.
#
# Files that are not part of the templates will be ignored by default.
unmanaged_files:
- 'lib/main.dart'
- 'ios/Runner.xcodeproj/project.pbxproj'
29 changes: 29 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
BSD 3-Clause License

Copyright (c) 2023, Jerome George
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Upscaler GUI

A GUI frontend for [Real-ESRGAN](https://github.com/xinntao/Real-ESRGAN)

## Installation

- Download the Upscaler GUI from the releases page
- Visit the official github repository of Real-ESRGAN and download the ` Windows executable files for Intel/AMD/Nvidia GPU.`
- Unzip both files
- Copy all files from Upscaler,s folder and place it in the Real-ESRGAN folder
- Click on upscalergui.exe to start the application.
- Its recommended to pin to taskbar or create a desktop shortcut

## ⚠️Warning
We would like to clarify that the developer of this application is not affiliated with the `Real-ESRGAN `Project and does not claim any rights to it. The purpose of this application is to serve as a graphical user interface for the `Real-ESRGAN` application. Please note that the `Real-ESRGAN` application is not included with the upscaler app, and users are directed to download it from the source repository. As with any software, standard disclaimers apply.
## 🎁Contribute
We are pleased to offer the Upscaler GUI as a `free and open-source project`. We encourage you to utilize the application and provide feedback by reporting any issues or bugs on our issue page. Additionally, we welcome contributions in the form of new features and code to further enhance the project.

Your support is greatly appreciated. If you find our GitHub page to be of value, we kindly request that you consider leaving a `star` to help us continue to improve and provide quality content. Thank you for your consideration.
29 changes: 29 additions & 0 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# This file configures the analyzer, which statically analyzes Dart code to
# check for errors, warnings, and lints.
#
# The issues identified by the analyzer are surfaced in the UI of Dart-enabled
# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
# invoked from the command line by running `flutter analyze`.

# The following line activates a set of recommended lints for Flutter apps,
# packages, and plugins designed to encourage good coding practices.
include: package:flutter_lints/flutter.yaml

linter:
# The lint rules applied to this project can be customized in the
# section below to disable rules from the `package:flutter_lints/flutter.yaml`
# included above or to enable additional rules. A list of all available lints
# and their documentation is published at
# https://dart-lang.github.io/linter/lints/index.html.
#
# Instead of disabling a lint rule for the entire project in the
# section below, it can also be suppressed for a single line of code
# or a specific dart file by using the `// ignore: name_of_lint` and
# `// ignore_for_file: name_of_lint` syntax on the line or in the file
# producing the lint.
rules:
# avoid_print: false # Uncomment to disable the `avoid_print` rule
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule

# Additional information about this file can be found at
# https://dart.dev/guides/language/analysis-options
Binary file added assets/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/sdimg_lq.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/sdimg_up.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
150 changes: 150 additions & 0 deletions lib/commonbtn.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
import 'package:flutter/material.dart';
import 'package:toggle_switch/toggle_switch.dart';
import 'package:upscalergui/execute.dart';

import 'constants.dart';

class commonbtn extends StatefulWidget {
const commonbtn({super.key});

@override
State<commonbtn> createState() => _commonbtnState();
}

class _commonbtnState extends State<commonbtn> {
bool _isProcessing = false;
String dropdownValue = "realesr-animevideov3";
@override
Widget build(BuildContext context) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
SizedBox(
height: 18,
),
Text(
"Model name",
style: txtstyle,
),
Container(
width: 230,
alignment: Alignment.topLeft,
child: DropdownButtonFormField<String>(
value: dropdownValue,
isExpanded: true,
dropdownColor: bgcolor,
icon: const Icon(Icons.arrow_circle_down_rounded),
elevation: 1,
items: [
'realesr-animevideov3',
'realesrgan-x4plus',
'realesrgan-x4plus-anime',
'realesrnet-x4plus'
].map<DropdownMenuItem<String>>((String value) {
return DropdownMenuItem<String>(
value: value,
child: Text(
value,
style: TextStyle(
fontWeight: FontWeight.w400,
color: btncolor,
fontSize: 18),
),
);
}).toList(),
onChanged: (String? value) {
setState(() {
dropdownValue = value!;
print(dropdownValue);
mdname = dropdownValue;
});
},
),
),
SizedBox(
height: 18,
),
Text(
"Upscale ratio",
style: txtstyle,
),
SizedBox(
height: 18,
),
ToggleSwitch(
minWidth: 45.0,
cornerRadius: 10.0,
activeFgColor: Colors.black,
activeBgColor: [btncolor, btncolor],
inactiveFgColor: btncolor,
initialLabelIndex: 3,
totalSwitches: 4,
labels: ['1x', '2x', '3x', '4x'],
onToggle: (index) {
upvalue = index!;
upratio = upvalue + 1;
},
),
SizedBox(
height: 18,
),
Text(
"Image format",
style: txtstyle,
),
SizedBox(
height: 18,
),
ToggleSwitch(
minWidth: 60.0,
cornerRadius: 10.0,
activeFgColor: Colors.black,
activeBgColor: [btncolor, btncolor],
inactiveFgColor: btncolor,
initialLabelIndex: 1,
totalSwitches: 3,
labels: ['Jpg', 'Png', 'Webp'],
onToggle: (index) {
print('switched to: $index');
imgtypeno = index!;
print("clciked up state");
},
),
SizedBox(
height: 25,
),
_isProcessing
? CircularProgressIndicator()
: MaterialButton(
onPressed: () async {
setState(() {
_isProcessing = true;
});
await upscale();
setState(() {
_isProcessing = false;
});
if (errcheck == 1) {
showerrdialog(context);
setState(() {
errcheck = 0;
});
} else {
await showscsdialog(context);
}
},
color: btncolor,
height: 50,
minWidth: 200,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(5)),
child: Text(
"Upscale",
style: TextStyle(color: Colors.black, fontSize: 22),
),
),
],
);
}
}
38 changes: 38 additions & 0 deletions lib/constants.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';

var bgcolor = Color.fromRGBO(24, 24, 24, 1);
var btnpresscolor = Color.fromRGBO(94, 35, 4, 1);
var filebtncolor = Color.fromRGBO(24, 24, 24, 1);
var folderbtncolor = Color.fromRGBO(24, 24, 24, 1);

var btncolor = Color.fromRGBO(252, 100, 18, 1);
var txtcolor = Color.fromRGBO(247, 106, 30, 1);
var txtstyle = GoogleFonts.poppins(
textStyle: TextStyle(
color: Colors.white, fontSize: 18, fontWeight: FontWeight.w500));
var h1txtstyle = GoogleFonts.poppins(
textStyle:
TextStyle(color: txtcolor, fontSize: 25, fontWeight: FontWeight.w600));
var alttxt = GoogleFonts.poppins(
textStyle: TextStyle(
color: Colors.white, fontWeight: FontWeight.w400, fontSize: 20));
var smltxt = GoogleFonts.poppins(
textStyle: TextStyle(
color: Colors.white, fontWeight: FontWeight.w200, fontSize: 17));
int ffvalue = 0;
int upvalue = 0;
String? outdir;
String? indir;
int upratio = 4;
String imgtype = 'png';
String mdname = 'realesr-animevideov3';
int imgtypeno = 1;
String filepath = '';
String inputfilepath = 'assets/sdimg_lq.png';
String outputfilepath = 'assets/sdimg_up.png';
final inputtxtController = TextEditingController();
String? outname;
String? cmd;
String? checks;
int errcheck = 0;
Loading

0 comments on commit 490410c

Please sign in to comment.