Image-to-Image
Diffusers
Safetensors
PyTorch
flux2
flux
image-upscaling
latent-upscaling
super-resolution
diffusion
flow-matching
rectified-flow
generative-models
image-generation
Instructions to use MinhNH232331M/FlowUpscaler-diffusers with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use MinhNH232331M/FlowUpscaler-diffusers with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline from diffusers.utils import load_image # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("MinhNH232331M/FlowUpscaler-diffusers", torch_dtype=torch.bfloat16, device_map="cuda") prompt = "Turn this cat into a dog" input_image = load_image("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/cat.png") image = pipe(image=input_image, prompt=prompt).images[0] - Notebooks
- Google Colab
- Kaggle
Upload folder using huggingface_hub
Browse files- .gitattributes +6 -0
- .vscode/settings.json +4 -0
- README.md +24 -0
- __pycache__/flow_upscaler_pipeline.cpython-313.pyc +0 -0
- __pycache__/upscaler_unet.cpython-313.pyc +0 -0
- demo_images/compare_color_fix.png +3 -0
- demo_images/compare_latent_transplant.png +3 -0
- demo_images/input_320x480.jpg +3 -0
- demo_images/upscaled_4x_default.png +3 -0
- demo_images/upscaled_4x_no_color_fix.png +3 -0
- demo_images/upscaled_4x_transplant_off.png +3 -0
.gitattributes
CHANGED
|
@@ -33,3 +33,9 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
demo_images/compare_color_fix.png filter=lfs diff=lfs merge=lfs -text
|
| 37 |
+
demo_images/compare_latent_transplant.png filter=lfs diff=lfs merge=lfs -text
|
| 38 |
+
demo_images/input_320x480.jpg filter=lfs diff=lfs merge=lfs -text
|
| 39 |
+
demo_images/upscaled_4x_default.png filter=lfs diff=lfs merge=lfs -text
|
| 40 |
+
demo_images/upscaled_4x_no_color_fix.png filter=lfs diff=lfs merge=lfs -text
|
| 41 |
+
demo_images/upscaled_4x_transplant_off.png filter=lfs diff=lfs merge=lfs -text
|
.vscode/settings.json
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"python-envs.defaultEnvManager": "ms-python.python:conda",
|
| 3 |
+
"python-envs.defaultPackageManager": "ms-python.python:conda"
|
| 4 |
+
}
|
README.md
CHANGED
|
@@ -158,6 +158,30 @@ after 1 pass and +14.8% after 2; the latent mean drift is ~0.1 sigma per pass on
|
|
| 158 |
-0.02, RGB means <= 0.9/255) — every drift mode above is created by the flow
|
| 159 |
UNet or by the correction stack itself.
|
| 160 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 161 |
### Nyquist / frequency-band analysis
|
| 162 |
|
| 163 |
Band bookkeeping, with frequencies written as fractions of each grid's
|
|
|
|
| 158 |
-0.02, RGB means <= 0.9/255) — every drift mode above is created by the flow
|
| 159 |
UNet or by the correction stack itself.
|
| 160 |
|
| 161 |
+
### Visual demo
|
| 162 |
+
|
| 163 |
+
One-image walkthrough of the two knobs (`demo_images/`): a 320x480 portrait
|
| 164 |
+
upscaled 2 passes (4x) at seed 42.
|
| 165 |
+
|
| 166 |
+
**Color fix** — both runs at `transplant_strength = 0` so the output
|
| 167 |
+
structure matches the original and only color differs. Uncorrected, the skin
|
| 168 |
+
drifts visibly pale/green (R −3.1, G −0.5, B −2.8 /255 mean cast; mean
|
| 169 |
+
chroma +3.5%); with the fix, means pin to within 0.2/255 and chroma to +0.1%:
|
| 170 |
+
|
| 171 |
+

|
| 172 |
+
|
| 173 |
+
**Latent transplant** — both runs at `color_fix_strength = 1`. Strength 1
|
| 174 |
+
nearly doubles measured sharpness (mean abs Laplacian 1.40 -> 2.71) at the
|
| 175 |
+
cost of input fidelity (PSNR to input 43.1 -> 40.8 dB) — the
|
| 176 |
+
fidelity/realism tradeoff, visible in the lashes and iris detail:
|
| 177 |
+
|
| 178 |
+

|
| 179 |
+
|
| 180 |
+
Inputs and full outputs for all three settings are in `demo_images/`. Color
|
| 181 |
+
metrics for this demo were measured through the gradio demo's lossy webp
|
| 182 |
+
output, which inflates the residual percentiles slightly; the tables above
|
| 183 |
+
use the lossless notebook protocol.
|
| 184 |
+
|
| 185 |
### Nyquist / frequency-band analysis
|
| 186 |
|
| 187 |
Band bookkeeping, with frequencies written as fractions of each grid's
|
__pycache__/flow_upscaler_pipeline.cpython-313.pyc
ADDED
|
Binary file (23.6 kB). View file
|
|
|
__pycache__/upscaler_unet.cpython-313.pyc
ADDED
|
Binary file (28.5 kB). View file
|
|
|
demo_images/compare_color_fix.png
ADDED
|
Git LFS Details
|
demo_images/compare_latent_transplant.png
ADDED
|
Git LFS Details
|
demo_images/input_320x480.jpg
ADDED
|
Git LFS Details
|
demo_images/upscaled_4x_default.png
ADDED
|
Git LFS Details
|
demo_images/upscaled_4x_no_color_fix.png
ADDED
|
Git LFS Details
|
demo_images/upscaled_4x_transplant_off.png
ADDED
|
Git LFS Details
|