Update Readme
Browse files
README.md
CHANGED
|
@@ -4,6 +4,7 @@ tags:
|
|
| 4 |
- lora
|
| 5 |
- diffusers
|
| 6 |
- template:diffusion-lora
|
|
|
|
| 7 |
widget:
|
| 8 |
- text: >-
|
| 9 |
"[FOUR-VIEWS] This set of four images show different angles of a light blue
|
|
@@ -13,15 +14,6 @@ widget:
|
|
| 13 |
photo shows a back view of the bag."
|
| 14 |
output:
|
| 15 |
url: images/composite_example.jpeg
|
| 16 |
-
- text: '-'
|
| 17 |
-
output:
|
| 18 |
-
url: images/composite_example.jpeg
|
| 19 |
-
- text: '-'
|
| 20 |
-
output:
|
| 21 |
-
url: images/004.png
|
| 22 |
-
- text: '-'
|
| 23 |
-
output:
|
| 24 |
-
url: images/composite_example.jpeg
|
| 25 |
- text: >-
|
| 26 |
[FOUR-VIEWS] a red desk lamp from multiple views;[TOP-LEFT] This photo shows
|
| 27 |
a 45-degree angle of desk lamp;[TOP-RIGHT] This photo shows a high-angle
|
|
@@ -32,7 +24,7 @@ widget:
|
|
| 32 |
base_model: black-forest-labs/FLUX.1-dev
|
| 33 |
instance_prompt: '[FOUR-VIEWS]'
|
| 34 |
license: apache-2.0
|
| 35 |
-
|
| 36 |
---
|
| 37 |
# fourviews-incontext-lora
|
| 38 |
|
|
@@ -40,47 +32,60 @@ license: apache-2.0
|
|
| 40 |
|
| 41 |
## Model description
|
| 42 |
|
| 43 |
-
|
| 44 |
-
license: apache-2.0
|
| 45 |
-
base_model: black-forest-labs/FLUX-1-dev
|
| 46 |
-
tags:
|
| 47 |
-
- flux
|
| 48 |
-
- lora
|
| 49 |
- 2x2-grid
|
| 50 |
- in-context
|
| 51 |
model_type: lora
|
| 52 |
-
---
|
| 53 |
|
| 54 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 55 |
|
| 56 |
**Base:** FLUX-1-dev
|
| 57 |
**Images:** 126 custom composites
|
| 58 |
**Steps:** 800 (≈ 12.7 epochs)
|
| 59 |
**Rank:** 8
|
| 60 |
-
**Trigger token:**
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 73 |
).images[0]
|
| 74 |
-
img.save("dragon_grid.png")
|
| 75 |
|
|
|
|
|
|
|
|
|
|
| 76 |
|
| 77 |
## Trigger words
|
| 78 |
|
| 79 |
You should use `[FOUR-VIEWS]` to trigger the image generation.
|
| 80 |
|
| 81 |
|
| 82 |
-
|
| 83 |
|
| 84 |
Weights for this model are available in Safetensors format.
|
| 85 |
|
| 86 |
-
[Download](/rmsandu/fourviews-incontext-lora/tree/main) them in the Files & versions tab.
|
|
|
|
| 4 |
- lora
|
| 5 |
- diffusers
|
| 6 |
- template:diffusion-lora
|
| 7 |
+
- flux
|
| 8 |
widget:
|
| 9 |
- text: >-
|
| 10 |
"[FOUR-VIEWS] This set of four images show different angles of a light blue
|
|
|
|
| 14 |
photo shows a back view of the bag."
|
| 15 |
output:
|
| 16 |
url: images/composite_example.jpeg
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
- text: >-
|
| 18 |
[FOUR-VIEWS] a red desk lamp from multiple views;[TOP-LEFT] This photo shows
|
| 19 |
a 45-degree angle of desk lamp;[TOP-RIGHT] This photo shows a high-angle
|
|
|
|
| 24 |
base_model: black-forest-labs/FLUX.1-dev
|
| 25 |
instance_prompt: '[FOUR-VIEWS]'
|
| 26 |
license: apache-2.0
|
| 27 |
+
pipeline_tag: text-to-image
|
| 28 |
---
|
| 29 |
# fourviews-incontext-lora
|
| 30 |
|
|
|
|
| 32 |
|
| 33 |
## Model description
|
| 34 |
|
| 35 |
+
base_model: black-forest-labs;FLUX-1-dev
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 36 |
- 2x2-grid
|
| 37 |
- in-context
|
| 38 |
model_type: lora
|
|
|
|
| 39 |
|
| 40 |
+
Inspired by [In-Context-LoRA](https://github.com/ali-vilab/In-Context-LoRA), this project aims to generate four multi-view images of the same scene or object simultaneously. By using flux with the multiview-incontext-lora, we can divide the images into portions to obtain novel views.
|
| 41 |
+
|
| 42 |
+
> **_NOTE:_** This is a beta release of the model. The consistency between views may not be perfect, and the model might sometimes generate views that don't perfectly align or maintain exact object positions across viewpoints.
|
| 43 |
+
|
| 44 |
+
|
| 45 |
+
# [FOUR-VIEWS]` 2 × 2-Grid LoRA
|
| 46 |
|
| 47 |
**Base:** FLUX-1-dev
|
| 48 |
**Images:** 126 custom composites
|
| 49 |
**Steps:** 800 (≈ 12.7 epochs)
|
| 50 |
**Rank:** 8
|
| 51 |
+
**Trigger token:**[FOUR-VIEWS];
|
| 52 |
+
|
| 53 |
+
```python
|
| 54 |
+
import torch
|
| 55 |
+
from diffusers import FluxPipeline
|
| 56 |
+
|
| 57 |
+
pipeline = FluxPipeline.from_pretrained(
|
| 58 |
+
"black-forest-labs/FLUX.1-dev",
|
| 59 |
+
torch_dtype=torch.bfloat16,
|
| 60 |
+
)
|
| 61 |
+
pipeline.load_lora_weights(
|
| 62 |
+
"rmsandu/fourviews-incontext-lora",
|
| 63 |
+
weight_name="twoview-incontext-b03.safetensors",
|
| 64 |
+
)
|
| 65 |
+
pipeline.fuse_lora()
|
| 66 |
+
|
| 67 |
+
prompt = f"[FOUR-VIEWS] This set of four images shows a jade dragon statue different viewpoints. [TOP-LEFT] This photo shows a 45-degree angle of jade statue;[TOP-RIGHT] This photo shows a high-angle shot of the statue; [BOTTOM-LEFT] Here is a side view shot of the statue; [BOTTOM-RIGHT] The back view of the statue."
|
| 68 |
+
image_height = 512
|
| 69 |
+
image_width = 512
|
| 70 |
+
output = pipeline(
|
| 71 |
+
prompt=prompt,
|
| 72 |
+
height=int(image_height),
|
| 73 |
+
width=int(image_width),
|
| 74 |
+
num_inference_steps=30,
|
| 75 |
+
guidance_scale=3.5,
|
| 76 |
).images[0]
|
|
|
|
| 77 |
|
| 78 |
+
output.save("fourview-incontext-beta.png")
|
| 79 |
+
|
| 80 |
+
```
|
| 81 |
|
| 82 |
## Trigger words
|
| 83 |
|
| 84 |
You should use `[FOUR-VIEWS]` to trigger the image generation.
|
| 85 |
|
| 86 |
|
| 87 |
+
# Download model
|
| 88 |
|
| 89 |
Weights for this model are available in Safetensors format.
|
| 90 |
|
| 91 |
+
[Download](/rmsandu/fourviews-incontext-lora/tree/main) them in the Files & versions tab.
|