aditya-rAj19 commited on
Commit
9236d5d
·
1 Parent(s): 033f363

fix: Download button now serves the real 4K PNG, not the preview

Browse files

The download link pointed at result.result_image (the base64 preview JPEG at
swap resolution), so "Download PNG" never delivered the 4K output. Point it at
/api/download/<output_file>, which serves the RealESRGAN/Lanczos 4K PNG saved
server-side. Relabeled "Download 4K PNG". Also gitignore external/ (vendored
HairFastGAN + multi-GB weights for the local GPU hair model).

Responsiveness verified across landing + app: fluid clamp() type, grid-cols-1
md:grid-cols-3 panels, flex-col sm:flex-row actions, flex-wrap chips, w-full
sm:w-auto buttons, overflow-x-hidden, viewport meta present.

Files changed (2) hide show
  1. .gitignore +3 -0
  2. frontend/src/pages/AppPage.jsx +3 -2
.gitignore CHANGED
@@ -49,3 +49,6 @@ desktop.ini
49
  # Logs
50
  *.log
51
  npm-debug.log*
 
 
 
 
49
  # Logs
50
  *.log
51
  npm-debug.log*
52
+
53
+ # Vendored HairFastGAN repo + multi-GB weights (local GPU hair transfer)
54
+ external/
frontend/src/pages/AppPage.jsx CHANGED
@@ -609,14 +609,15 @@ export default function AppPage() {
609
 
610
  {/* download row: full width on mobile, auto on sm+ */}
611
  <div className="flex flex-col sm:flex-row gap-3 justify-center">
612
- <a href={result.result_image} download="face_swap_result.png"
 
613
  className="flex items-center justify-center gap-2 bg-gradient-to-r from-olive to-lime text-forest px-5 sm:px-6 py-3 rounded-xl font-bold text-sm hover:-translate-y-0.5 transition-all duration-200 w-full sm:w-auto">
614
  <svg className="w-4 h-4 shrink-0" fill="none" stroke="currentColor" strokeWidth={2} viewBox="0 0 24 24">
615
  <path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/>
616
  <polyline points="7 10 12 15 17 10"/>
617
  <line x1="12" y1="15" x2="12" y2="3"/>
618
  </svg>
619
- Download PNG
620
  </a>
621
  <button onClick={reset}
622
  className="flex items-center justify-center gap-2 border border-border text-sage px-5 py-3 rounded-xl text-sm font-semibold hover:border-border2 hover:text-lime transition-colors w-full sm:w-auto">
 
609
 
610
  {/* download row: full width on mobile, auto on sm+ */}
611
  <div className="flex flex-col sm:flex-row gap-3 justify-center">
612
+ <a href={result.output_file ? `/api/download/${result.output_file}` : result.result_image}
613
+ download="face_swap_result.png"
614
  className="flex items-center justify-center gap-2 bg-gradient-to-r from-olive to-lime text-forest px-5 sm:px-6 py-3 rounded-xl font-bold text-sm hover:-translate-y-0.5 transition-all duration-200 w-full sm:w-auto">
615
  <svg className="w-4 h-4 shrink-0" fill="none" stroke="currentColor" strokeWidth={2} viewBox="0 0 24 24">
616
  <path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/>
617
  <polyline points="7 10 12 15 17 10"/>
618
  <line x1="12" y1="15" x2="12" y2="3"/>
619
  </svg>
620
+ Download 4K PNG
621
  </a>
622
  <button onClick={reset}
623
  className="flex items-center justify-center gap-2 border border-border text-sage px-5 py-3 rounded-xl text-sm font-semibold hover:border-border2 hover:text-lime transition-colors w-full sm:w-auto">