Update README.md
Browse files
README.md
CHANGED
|
@@ -70,30 +70,29 @@ Example with Depth-to-Image:
|
|
| 70 |
import torch
|
| 71 |
from diffusers import VisualClozePipeline
|
| 72 |
from diffusers.utils import load_image
|
| 73 |
-
from PIL import Image
|
| 74 |
|
| 75 |
# Load in-context images (make sure the paths are correct and accessible)
|
| 76 |
image_paths = [
|
| 77 |
# in-context examples
|
| 78 |
[
|
| 79 |
-
load_image('https://github.com/lzyhha/VisualCloze/
|
| 80 |
-
load_image('https://github.com/lzyhha/VisualCloze/
|
| 81 |
],
|
| 82 |
# query with the target image
|
| 83 |
[
|
| 84 |
-
load_image('https://github.com/lzyhha/VisualCloze/
|
| 85 |
None, # No image needed for the query in this case
|
| 86 |
],
|
| 87 |
]
|
| 88 |
|
| 89 |
# Task and content prompt
|
| 90 |
task_prompt = "Each row outlines a logical process, starting from [IMAGE1] gray-based depth map with detailed object contours, to achieve [IMAGE2] an image with flawless clarity."
|
| 91 |
-
content_prompt = """
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
The
|
| 96 |
-
|
| 97 |
|
| 98 |
# Load the VisualClozePipeline
|
| 99 |
pipe = VisualClozePipeline.from_pretrained("VisualCloze/VisualClozePipeline-384", torch_dtype=torch.bfloat16)
|
|
@@ -104,11 +103,11 @@ image_result = pipe(
|
|
| 104 |
task_prompt=task_prompt,
|
| 105 |
content_prompt=content_prompt,
|
| 106 |
image=image_paths,
|
| 107 |
-
|
| 108 |
-
|
| 109 |
upsampling_strength=0.4,
|
| 110 |
guidance_scale=30,
|
| 111 |
-
num_inference_steps=
|
| 112 |
max_sequence_length=512,
|
| 113 |
generator=torch.Generator("cpu").manual_seed(0)
|
| 114 |
).images[0]
|
|
|
|
| 70 |
import torch
|
| 71 |
from diffusers import VisualClozePipeline
|
| 72 |
from diffusers.utils import load_image
|
|
|
|
| 73 |
|
| 74 |
# Load in-context images (make sure the paths are correct and accessible)
|
| 75 |
image_paths = [
|
| 76 |
# in-context examples
|
| 77 |
[
|
| 78 |
+
load_image('https://github.com/lzyhha/VisualCloze/raw/main/examples/examples/93bc1c43af2d6c91ac2fc966bf7725a2/93bc1c43af2d6c91ac2fc966bf7725a2_depth-anything-v2_Large.jpg'),
|
| 79 |
+
load_image('https://github.com/lzyhha/VisualCloze/raw/main/examples/examples/93bc1c43af2d6c91ac2fc966bf7725a2/93bc1c43af2d6c91ac2fc966bf7725a2.jpg'),
|
| 80 |
],
|
| 81 |
# query with the target image
|
| 82 |
[
|
| 83 |
+
load_image('https://github.com/lzyhha/VisualCloze/raw/main/examples/examples/79f2ee632f1be3ad64210a641c4e201b/79f2ee632f1be3ad64210a641c4e201b_depth-anything-v2_Large.jpg'),
|
| 84 |
None, # No image needed for the query in this case
|
| 85 |
],
|
| 86 |
]
|
| 87 |
|
| 88 |
# Task and content prompt
|
| 89 |
task_prompt = "Each row outlines a logical process, starting from [IMAGE1] gray-based depth map with detailed object contours, to achieve [IMAGE2] an image with flawless clarity."
|
| 90 |
+
content_prompt = """A serene portrait of a young woman with long dark hair, wearing a beige dress with intricate
|
| 91 |
+
gold embroidery, standing in a softly lit room. She holds a large bouquet of pale pink roses in a black box,
|
| 92 |
+
positioned in the center of the frame. The background features a tall green plant to the left and a framed artwork
|
| 93 |
+
on the wall to the right. A window on the left allows natural light to gently illuminate the scene.
|
| 94 |
+
The woman gazes down at the bouquet with a calm expression. Soft natural lighting, warm color palette,
|
| 95 |
+
high contrast, photorealistic, intimate, elegant, visually balanced, serene atmosphere."""
|
| 96 |
|
| 97 |
# Load the VisualClozePipeline
|
| 98 |
pipe = VisualClozePipeline.from_pretrained("VisualCloze/VisualClozePipeline-384", torch_dtype=torch.bfloat16)
|
|
|
|
| 103 |
task_prompt=task_prompt,
|
| 104 |
content_prompt=content_prompt,
|
| 105 |
image=image_paths,
|
| 106 |
+
upsampling_width=1024,
|
| 107 |
+
upsampling_height=1024,
|
| 108 |
upsampling_strength=0.4,
|
| 109 |
guidance_scale=30,
|
| 110 |
+
num_inference_steps=30,
|
| 111 |
max_sequence_length=512,
|
| 112 |
generator=torch.Generator("cpu").manual_seed(0)
|
| 113 |
).images[0]
|