Shitao commited on
Commit
4004f94
1 Parent(s): 103a228

update example

Browse files
app.py CHANGED
@@ -47,48 +47,122 @@ def generate_image(text, img1, img2, img3, height, width, guidance_scale, infere
47
  def get_example():
48
  case = [
49
  [
50
- "A woman holds a bouquet of flowers and faces the camera.",
51
  None,
52
  None,
53
  None,
54
  1024,
55
  1024,
56
- 3.0,
57
  50,
58
- 42,
59
  ],
60
  [
61
- "A woman holds a bouquet of flowers and faces the camera. Thw woman is the one in <img><|image_1|></img>.",
62
- "./imgs/test_cases/liuyifei.png",
63
  None,
64
  None,
65
  1024,
66
  1024,
67
- 3.0,
68
  50,
69
- 42,
 
 
 
 
 
 
 
 
 
 
 
70
  ],
71
  [
72
- "Three zebras are standing side by side on a vibrant savannah, each showcasing unique patterns and characteristics that highlight their individuality. The zebra on the left has a strikingly bold black and white stripe pattern, with wider stripes that create a dramatic contrast against its sleek body. In the middle, the zebra features a more subtle stripe arrangement, with thinner stripes that blend seamlessly into a slightly sandy-colored coat, giving it a softer appearance. On the right, the zebra's stripes are more irregular, with a distinct patch of brown fur near its shoulder, adding a layer of uniqueness to its overall look. Together, these zebras create a captivating scene, each representing the diverse beauty of their species in the wild. The right zebras is the zebras from <img><|image_1|></img>. The center zebras is from <img><|image_2|></img>. The left zebras is the zebras from <img><|image_3|></img>.",
73
- "./imgs/test_cases/img1.jpg",
74
  "./imgs/test_cases/img2.jpg",
75
- "./imgs/test_cases/img3.jpg",
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
76
  1024,
77
  1024,
78
- 3.0,
79
  50,
80
  42,
81
  ],
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
82
  ]
83
  return case
84
 
85
  def run_for_examples(text, img1, img2, img3, height, width, guidance_scale, inference_steps, seed):
86
  return generate_image(text, img1, img2, img3, height, width, guidance_scale, inference_steps, seed)
87
 
 
 
 
 
 
 
 
88
 
89
  # Gradio 接口
90
  with gr.Blocks() as demo:
91
  gr.Markdown("# OmniGen: Unified Image Generation [paper](https://arxiv.org/abs/2409.11340) [code](https://github.com/VectorSpaceLab/OmniGen)")
 
92
  with gr.Row():
93
  with gr.Column():
94
  # 文本输入框
 
47
  def get_example():
48
  case = [
49
  [
50
+ "A vintage camera placed on the ground, ejecting a swirling cloud of Polaroid-style photographs into the air. The photos, showing landscapes, wildlife, and travel scenes, seem to defy gravity, floating upward in a vortex of motion. The camera emits a glowing, smoky light from within, enhancing the magical, surreal atmosphere. The dark background contrasts with the illuminated photos and camera, creating a dreamlike, nostalgic scene filled with vibrant colors and dynamic movement. Scattered photos are visible on the ground, further contributing to the idea of an explosion of captured memories.",
51
  None,
52
  None,
53
  None,
54
  1024,
55
  1024,
56
+ 2.5,
57
  50,
58
+ 0,
59
  ],
60
  [
61
+ "A woman <img><|image_1|></img> in a wedding dress. Next to her is a black-haired man.",
62
+ "./imgs/test_cases/yifei2.png",
63
  None,
64
  None,
65
  1024,
66
  1024,
67
+ 2.5,
68
  50,
69
+ 0,
70
+ ],
71
+ [
72
+ "A man in a black shirt is reading a book. The man is the right man in <img><|image_1|></img>.",
73
+ "./imgs/test_cases/two_man.jpg",
74
+ None,
75
+ None,
76
+ 1024,
77
+ 1024,
78
+ 2.5,
79
+ 50,
80
+ 0,
81
  ],
82
  [
83
+ "Two men are celebrating with raised glasses in a restaurant. A man is <img><|image_1|></img>. The other man is <img><|image_2|></img>.",
84
+ "./imgs/test_cases/young_musk.jpg",
85
  "./imgs/test_cases/img2.jpg",
86
+ None,
87
+ 1024,
88
+ 1024,
89
+ 2.5,
90
+ 50,
91
+ 0,
92
+ ],
93
+ [
94
+ "<img><|image_1|><img>\n Remove the woman's earrings. Replace the mug with a clear glass filled with sparkling iced cola.",
95
+ "./imgs/demo_cases/t2i_woman_with_book.png",
96
+ None,
97
+ None,
98
+ 1024,
99
+ 1024,
100
+ 2.5,
101
+ 50,
102
+ 222,
103
+ ],
104
+ [
105
+ "Detect the skeleton of human in this image: <img><|image_1|></img>.",
106
+ "./imgs/test_cases/control.jpg",
107
+ None,
108
+ None,
109
+ 1024,
110
+ 1024,
111
+ 2.0,
112
+ 50,
113
+ 0,
114
+ ],
115
+ [
116
+ "Generate a new photo using the following picture and text as conditions: <img><|image_1|><img>\n A young boy is sitting on a sofa in the library, holding a book. His hair is neatly combed, and a faint smile plays on his lips, with a few freckles scattered across his cheeks. The library is quiet, with rows of shelves filled with books stretching out behind him.",
117
+ "./imgs/demo_cases/skeletal.png",
118
+ None,
119
+ None,
120
  1024,
121
  1024,
122
+ 2,
123
  50,
124
  42,
125
  ],
126
+ [
127
+ "Following the pose of this image <img><|image_1|><img>, generate a new photo: A young boy is sitting on a sofa in the library, holding a book. His hair is neatly combed, and a faint smile plays on his lips, with a few freckles scattered across his cheeks. The library is quiet, with rows of shelves filled with books stretching out behind him.",
128
+ "./imgs/demo_cases/edit.png",
129
+ None,
130
+ None,
131
+ 1024,
132
+ 1024,
133
+ 2.0,
134
+ 50,
135
+ 123,
136
+ ],
137
+ [
138
+ "<img><|image_1|><\/img> What item can be used to see the current time? Please remove it.",
139
+ "./imgs/test_cases/watch.jpg",
140
+ None,
141
+ None,
142
+ 1024,
143
+ 1024,
144
+ 2.5,
145
+ 50,
146
+ 0,
147
+ ],
148
  ]
149
  return case
150
 
151
  def run_for_examples(text, img1, img2, img3, height, width, guidance_scale, inference_steps, seed):
152
  return generate_image(text, img1, img2, img3, height, width, guidance_scale, inference_steps, seed)
153
 
154
+ description = """
155
+ OmniGen is a unified image generation model that you can use to perform various tasks, including but not limited to text-to-image generation, subject-driven generation, Identity-Preserving Generation, and image-conditioned generation.
156
+
157
+ For multi-modal to image generation, you should pass a string as `prompt`, and a list of image paths as `input_images`. The placeholder in the prompt should be in the format of `<img><|image_*|></img>`.
158
+ For example, use a image of a woman to generate a new image:
159
+ prompt = "A woman holds a bouquet of flowers and faces the camera. Thw woman is <img><|image_1|></img>."
160
+ """
161
 
162
  # Gradio 接口
163
  with gr.Blocks() as demo:
164
  gr.Markdown("# OmniGen: Unified Image Generation [paper](https://arxiv.org/abs/2409.11340) [code](https://github.com/VectorSpaceLab/OmniGen)")
165
+ gr.Markdown(description)
166
  with gr.Row():
167
  with gr.Column():
168
  # 文本输入框
imgs/demo_cases.png ADDED

Git LFS Details

  • SHA256: 0517c97c947f8226f0f39b4ca2ac61b058e52faa59ec5085668062d0162dd21e
  • Pointer size: 132 Bytes
  • Size of remote file: 3.42 MB
imgs/demo_cases/AI_Pioneers.jpg ADDED

Git LFS Details

  • SHA256: 0b7f51ae11a11781027d1f9e1e8d566438f937508e16c627bfb60acca5b1d7c0
  • Pointer size: 131 Bytes
  • Size of remote file: 101 kB
imgs/demo_cases/edit.png ADDED

Git LFS Details

  • SHA256: 889f3da462745ffdb4c3300099ea941d0a75db3259e8eaa1dbc95f8a28f11c70
  • Pointer size: 132 Bytes
  • Size of remote file: 1.24 MB
imgs/demo_cases/entity.png ADDED

Git LFS Details

  • SHA256: f99af692215c6292ab64b26450bb1eb2b7bc6d5c2f450f21a9953e37455fe1b5
  • Pointer size: 132 Bytes
  • Size of remote file: 1.27 MB
imgs/demo_cases/reasoning.png ADDED

Git LFS Details

  • SHA256: 0df9b7aab47e59d792bf5148f1797eea966064dbf6fec3ba8b169facf51c09d7
  • Pointer size: 132 Bytes
  • Size of remote file: 1.24 MB
imgs/demo_cases/same_pose.png ADDED

Git LFS Details

  • SHA256: 2359fe0b95233c418f554e2dd98c39d9bc79053be0242569286f90d50201313a
  • Pointer size: 132 Bytes
  • Size of remote file: 1.36 MB
imgs/demo_cases/skeletal.png ADDED

Git LFS Details

  • SHA256: 7f05a79ce9ae0179fe4948568cb71dc3fbc8e9f6b2ecf5a839fa255dfce0aaf6
  • Pointer size: 131 Bytes
  • Size of remote file: 105 kB
imgs/demo_cases/skeletal2img.png ADDED

Git LFS Details

  • SHA256: 3d538579f45fce26053f2af83a7aea5be12f2270fba2282a17e9d3bae0c2e91d
  • Pointer size: 132 Bytes
  • Size of remote file: 1.32 MB
imgs/demo_cases/t2i_woman_with_book.png ADDED

Git LFS Details

  • SHA256: 624ae749478b4ced358c6482385fd35271cbfe25eea0581d2a323bffebde8b39
  • Pointer size: 132 Bytes
  • Size of remote file: 1.25 MB
imgs/overall.jpg ADDED

Git LFS Details

  • SHA256: ffa229632ac0bb248eee87cf823a0dc18c22c0a81a57d4c639e7fb1986d4e029
  • Pointer size: 132 Bytes
  • Size of remote file: 1.13 MB
imgs/test_cases/cat.jpeg ADDED

Git LFS Details

  • SHA256: 076d8d520f68d1cf2f6a66366721e03ad20cf9d385839f5c26b3d2060bb6d789
  • Pointer size: 129 Bytes
  • Size of remote file: 6.11 kB
imgs/test_cases/control.jpg ADDED

Git LFS Details

  • SHA256: 5ca485995cb5f4b1b792e39a99e9647745291f92689eb40f1da925f19dfdc1b5
  • Pointer size: 132 Bytes
  • Size of remote file: 1.32 MB
imgs/test_cases/lecun.png ADDED

Git LFS Details

  • SHA256: 99d66323fe33f81d561c481fce08eb43f03d110fdbe54b237f7f985f54d9102a
  • Pointer size: 131 Bytes
  • Size of remote file: 294 kB
imgs/test_cases/pose.png ADDED

Git LFS Details

  • SHA256: 9ef21d4a7117fd14a2057f653fa48e4a31f3fc849787fa188a8c1656657706d0
  • Pointer size: 130 Bytes
  • Size of remote file: 97.4 kB
imgs/test_cases/two_man.jpg ADDED

Git LFS Details

  • SHA256: 7c940253b06b1b32d472375b445474571bd7838a01fcd069b2ae34fb3e5d8d1f
  • Pointer size: 132 Bytes
  • Size of remote file: 1.28 MB
imgs/test_cases/watch.jpg ADDED

Git LFS Details

  • SHA256: f930542af14fc7816e32cc429cbd7855d4420ad797e1ff72aa523b61778ee9f4
  • Pointer size: 131 Bytes
  • Size of remote file: 493 kB
imgs/test_cases/woman.png ADDED

Git LFS Details

  • SHA256: 911f596d617d89bde63ecb8aaf1fde71d1fa183d4ac0cdac770a9fc8627a3b50
  • Pointer size: 132 Bytes
  • Size of remote file: 1.48 MB
imgs/test_cases/yifei2.png ADDED

Git LFS Details

  • SHA256: a0087233e61184829ab345d6be2991918e85727076e0d4f8c7bbfc865ca4d6d0
  • Pointer size: 131 Bytes
  • Size of remote file: 101 kB
imgs/test_cases/young_musk.jpg ADDED

Git LFS Details

  • SHA256: 91290c822c51d51302ae2d4e67b924d329b9b7faa767ca238f9b58736c0610f7
  • Pointer size: 130 Bytes
  • Size of remote file: 43.3 kB
imgs/test_cases/young_trump.jpeg ADDED

Git LFS Details

  • SHA256: 4329fdb452774bf0517e19c91065ea7e87e4d2e874c6e3da2d5ee8a64093b4a0
  • Pointer size: 131 Bytes
  • Size of remote file: 320 kB