Yw22 commited on
Commit
ceb5274
Β·
verified Β·
1 Parent(s): 53d8ad9

Add ViewWeaver model card and usage instructions

Browse files
Files changed (1) hide show
  1. README.md +106 -0
README.md CHANGED
@@ -1,3 +1,109 @@
1
  ---
2
  license: mit
 
 
 
 
 
 
 
 
 
 
 
 
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
  license: mit
3
+ language:
4
+ - en
5
+ base_model:
6
+ - black-forest-labs/FLUX.1-Kontext-dev
7
+ tags:
8
+ - viewweaver
9
+ - image-to-image
10
+ - multi-view
11
+ - 3d-aware
12
+ - image-customization
13
+ - lora
14
+ pipeline_tag: image-to-image
15
  ---
16
+
17
+ # ViewWeaver
18
+
19
+ **ViewWeaver: Geometry-Grounded Generative Rendering for 3D-Aware Image Customization**
20
+
21
+ ViewWeaver is a geometry-grounded generative rendering framework for 3D-aware image customization. Given multi-view reference images, a target camera, and a text instruction, it generates customized subject images while preserving subject identity and 3D structure across viewpoints and scenes.
22
+
23
+ This repository contains the ViewWeaver adapter and view-conditioning weights. Use them with the ViewWeaver inference code, [FLUX.1-Kontext-dev](https://huggingface.co/black-forest-labs/FLUX.1-Kontext-dev), and [VGGT-1B](https://huggingface.co/facebook/VGGT-1B).
24
+
25
+ ## Checkpoint contents
26
+
27
+ | File | Size (bytes) | Component |
28
+ | --- | ---: | --- |
29
+ | `lora_dit.safetensors` | 1,388,016,360 | Diffusion transformer LoRA weights |
30
+ | `view_moe_double.safetensors` | 89,694,626 | View-conditioning module for double-stream blocks |
31
+ | `view_moe_single.safetensors` | 89,694,626 | View-conditioning module for single-stream blocks |
32
+
33
+ All three files are required. The FLUX base model and VGGT weights must be downloaded separately. These files require the ViewWeaver custom loader and do not form a standalone Diffusers pipeline.
34
+
35
+ ## Download
36
+
37
+ Run from the ViewWeaver code directory. First obtain access to FLUX.1-Kontext-dev and accept its terms on its model page.
38
+
39
+ ```bash
40
+ hf auth login
41
+ hf download Yw22/ViewWeaver --local-dir checkpoints/viewweaver
42
+ hf download facebook/VGGT-1B --local-dir checkpoints/vggt
43
+ hf download black-forest-labs/FLUX.1-Kontext-dev --local-dir checkpoints/flux-kontext
44
+ ```
45
+
46
+ Expected layout:
47
+
48
+ ```text
49
+ checkpoints/
50
+ β”œβ”€β”€ viewweaver/
51
+ β”‚ β”œβ”€β”€ lora_dit.safetensors
52
+ β”‚ β”œβ”€β”€ view_moe_double.safetensors
53
+ β”‚ └── view_moe_single.safetensors
54
+ β”œβ”€β”€ vggt/
55
+ β”‚ └── model.safetensors
56
+ └── flux-kontext/
57
+ β”œβ”€β”€ model_index.json
58
+ β”œβ”€β”€ transformer/
59
+ β”œβ”€β”€ vae/
60
+ β”œβ”€β”€ text_encoder/
61
+ β”œβ”€β”€ text_encoder_2/
62
+ β”œβ”€β”€ tokenizer/
63
+ β”œβ”€β”€ tokenizer_2/
64
+ └── scheduler/
65
+ ```
66
+
67
+ ## Inference
68
+
69
+ Use a CUDA GPU with bfloat16 support. The following installation commands match the ViewWeaver project instructions for CUDA 12.8; choose an appropriate PyTorch build for other CUDA versions.
70
+
71
+ ```bash
72
+ conda create -n viewweaver python=3.12 -y
73
+ conda activate viewweaver
74
+ python -m pip install torch==2.8.0 torchvision==0.23.0 \
75
+ --index-url https://download.pytorch.org/whl/cu128
76
+
77
+ cd /path/to/ViewWeaver
78
+ python -m pip install -e '.[prepare]' \
79
+ 'numpy==1.26.4' 'opencv-python==4.11.0.86'
80
+ export PYTHON="$(command -v python)"
81
+ ```
82
+
83
+ After downloading the checkpoints, run the included Mario example from the code directory:
84
+
85
+ ```bash
86
+ CUDA_VISIBLE_DEVICES=0 bash scripts/run_case.sh --case examples/mario \
87
+ --reference-view 0 --azimuth -15 --elevation 15 \
88
+ --camera-distance 4.5 --offset-y 0.18 --save-comparison
89
+ ```
90
+
91
+ The default workflow uses eight reference images with foreground masks, performs VGGT geometry preparation, and generates one target view. Generation defaults are 1024 Γ— 1024 pixels, 32 steps, and guidance scale 3.5. Outputs are written to `outputs/<case>/<timestamp>/`, including the generated image, reference–target comparison, and `result.json`.
92
+
93
+ For your own inputs, provide a case directory with `case.json`, eight reference images, and matching foreground masks (white foreground, black background). RGBA images can supply foreground masks through their alpha channel. The ViewWeaver code documentation describes the full case format, reusable preparation caches, and camera controls.
94
+
95
+ ## License and dependencies
96
+
97
+ This repository retains its MIT license metadata. FLUX.1-Kontext-dev, VGGT, and any example assets remain subject to their respective licenses and terms; the repository metadata does not replace those terms.
98
+
99
+ ## Citation
100
+
101
+ ```bibtex
102
+ @inproceedings{li2026viewweaver,
103
+ title={ViewWeaver: Geometry-Grounded Generative Rendering for 3D-Aware Image Customization},
104
+ author={Li, Yaowei and Li, Xiaoyu and Zhang, Zhaoyang and Li, Hongxiang and Chen, Long and Shan, Ying and Zou, Yuexian},
105
+ booktitle={Proceedings of the Special Interest Group on Computer Graphics and Interactive Techniques Conference Conference Papers},
106
+ pages={1--12},
107
+ year={2026}
108
+ }
109
+ ```