lzyhha commited on
Commit
f50f1b5
·
verified ·
1 Parent(s): 6e6ebd4

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +12 -13
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/tree/main/examples/examples/5bf755ed9dbb9b3e223e7ba35232b06e/5bf755ed9dbb9b3e223e7ba35232b06e_depth-anything-v2_Large.jpg'),
80
- load_image('https://github.com/lzyhha/VisualCloze/tree/main/examples/examples/5bf755ed9dbb9b3e223e7ba35232b06e/5bf755ed9dbb9b3e223e7ba35232b06e.jpg'),
81
  ],
82
  # query with the target image
83
  [
84
- load_image('https://github.com/lzyhha/VisualCloze/tree/main/examples/examples/2b74476568f7562a6aa832d423132ed3/2b74476568f7562a6aa832d423132ed3_depth-anything-v2_Large.jpg'),
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 = """Group photo of five young adults enjoying a rooftop gathering at dusk. The group is positioned in the center, with three women and two men smiling and embracing.
92
- The woman on the far left wears a floral top and holds a drink, looking slightly to the right.
93
- Next to her, a woman in a denim jacket stands close to a woman in a white blouse, both smiling directly at the camera.
94
- The fourth woman, in an orange top, stands close to the man on the far right, who wears a red shirt and blue blazer, smiling broadly.
95
- The background features a cityscape with a tall building and string lights hanging overhead, creating a warm, festive atmosphere.
96
- Soft natural lighting, warm color palette, shallow depth of field, intimate and joyful mood, slightly blurred background, urban rooftop setting, evening ambiance."""
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
- height=1632,
108
- width=1232,
109
  upsampling_strength=0.4,
110
  guidance_scale=30,
111
- num_inference_steps=50,
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]