Madiy commited on
Commit
4af514d
Β·
verified Β·
1 Parent(s): fc9fb7d

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +67 -2
README.md CHANGED
@@ -4,11 +4,76 @@ emoji: πŸ“‰
4
  colorFrom: red
5
  colorTo: indigo
6
  sdk: gradio
7
- sdk_version: 6.20.0
8
  python_version: '3.12'
9
  app_file: app.py
10
  pinned: false
11
  short_description: AI Image Enhancer and Outpainter
12
  ---
13
 
14
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
  colorFrom: red
5
  colorTo: indigo
6
  sdk: gradio
7
+ sdk_version: 6.22.0
8
  python_version: '3.12'
9
  app_file: app.py
10
  pinned: false
11
  short_description: AI Image Enhancer and Outpainter
12
  ---
13
 
14
+ # CanvasAI
15
+
16
+ Three AI image tools in one interface β€” upscale and sharpen any photo, colorize black and white images automatically, or extend a scene beyond its original borders.
17
+
18
+ ---
19
+
20
+ ## Tools
21
+
22
+ ### ✨ Enhancement
23
+ Real-ESRGAN upscales images 2Γ— or 4Γ—, reconstructing fine detail rather than stretching pixels. Processes large images in tiles to stay within VRAM limits.
24
+
25
+ ### 🎨 Colorization
26
+ DDColor adds natural color to black and white images without changing structure or composition. Post-processed with LAB color space smoothing to reduce color patchiness, and a saturation boost to compensate for DDColor's tendency to under-saturate. Fully automatic β€” no prompt needed.
27
+
28
+ ### πŸ”² Outpainting
29
+ Extends your image in any direction using Stable Diffusion 2 Inpainting. BLIP reads the image and generates an appropriate prompt automatically. Uses a multi-pass 64px incremental approach with feathered mask blending for coherent results.
30
+
31
+ ---
32
+
33
+ ## How the Outpainting Works
34
+
35
+ The pipeline extends 64 pixels at a time rather than all at once. Each small pass gives SD 87%+ original image context β€” SD extrapolates naturally from what it can see. One large extension gives SD only 60-70% context, and the generated content becomes incoherent.
36
+
37
+ The mask uses GaussianBlur feathering so the boundary between original and generated content is a soft gradient rather than a hard cut. The mask is resized with LANCZOS (not NEAREST) to preserve this gradient when scaling to SD's 768Γ—768 input size.
38
+
39
+ ---
40
+
41
+ ## Honest Limitations
42
+
43
+ **Enhancement** does not deblur. It upscales and sharpens existing detail. Blurry input produces larger blurry output.
44
+
45
+ **Colorization** works well on portraits, street scenes, and landscapes. Complex fabric patterns and heavily degraded photographs may produce inconsistent colors. Results will not match commercial colorization tools.
46
+
47
+ **Outpainting** quality varies by input. Works best on simple consistent backgrounds at 25% extension or below. Struggles with complex foreground subjects near edges and high extension percentages. The multi-pass approach significantly improves over single-pass but does not eliminate the underlying model's limitations.
48
+
49
+ ---
50
+
51
+ ## Tips for Best Results
52
+
53
+ - Enhancement: works on any image, best on photographs with existing sharp detail
54
+ - Colorization: portraits and outdoor scenes colorize most consistently
55
+ - Outpainting: use Horizontal or Vertical (not Both), keep extension at 25%, use the custom prompt field if BLIP misreads your image
56
+
57
+ ---
58
+
59
+ ## Models Used
60
+
61
+ | Model | Purpose |
62
+ |---|---|
63
+ | RealESRGAN_x4plus | Super resolution |
64
+ | stable-diffusion-2-inpainting | Scene extension |
65
+ | blip-image-captioning-base | Auto prompt generation |
66
+ | cv_ddcolor_image-colorization | B&W colorization |
67
+
68
+ ---
69
+
70
+ ## Privacy
71
+
72
+ Images are processed in memory and not stored permanently. Uploaded images are deleted when your session ends. Do not upload sensitive or private images.
73
+
74
+ ---
75
+
76
+ ## GitHub
77
+
78
+ Full code, architecture notes, and documentation:
79
+ [github.com/yourusername/CanvasAI](https://github.com/yourusername/CanvasAI)