File size: 60,315 Bytes
bcd912d 0c837de bcd912d 0c837de bcd912d 0c837de bcd912d 0c837de bcd912d 0c837de bcd912d 0c837de bcd912d 0c837de bcd912d 0c837de bcd912d 0c837de bcd912d 0c837de bcd912d 0c837de bcd912d 0c837de bcd912d 0c837de bcd912d 0c837de bcd912d 0c837de bcd912d 5d81018 bcd912d 0c837de bcd912d 0c837de bcd912d |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 |
{
"cells": [
{
"cell_type": "code",
"execution_count": 5,
"id": "ce9ebe41-3fb5-459e-a800-416103fb3f4b",
"metadata": {
"scrolled": true
},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "164983bed91d4214a3616b7bbd5e6b98",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"Loading dataset from disk: 0%| | 0/128 [00:00<?, ?it/s]"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"384 384 An ancient-looking book cover adorned with intricate symbols, a pentagram, and a crescent moon, evoking mysticism and the occult, with worn edges suggesting a well-read or aged tome.\n",
"VAE scaling_factor = 1.0\n",
"256 384 A group of four men with long hair and tattoos are standing on a rooftop, laughing and looking at something with expressions of shock and excitement. They are dressed in casual clothing, with one man wearing a black t-shirt and another in a blue shirt. The men are positioned in the foreground, with the city skyline visible in the background. The lighting suggests it is either early morning or late afternoon, and the atmosphere appears to be one of camaraderie and shared joy.\n",
"VAE scaling_factor = 1.0\n",
"384 256 A sleek, black Audi sports car is on display in a modern showroom with a white floor and a blurred background, showcasing the vehicle's futuristic design and luxurious interior.\n",
"VAE scaling_factor = 1.0\n",
"192 384 In a bustling tavern, two individuals are sharing a jovial moment, clinking their mugs together in a toast. The atmosphere is warm and inviting, with the soft glow of lanterns casting a cozy light on the scene. The patrons, dressed in a variety of attire, add to the lively ambiance. The background is filled with the hustle and bustle of the tavern, with patrons enjoying their drinks and conversations. The focus is on the two central figures, their camaraderie and shared enjoyment of the moment.\n",
"VAE scaling_factor = 1.0\n",
"384 384 zero: A majestic american eagle is captured in mid-flight, its wings spread wide as it soars through a sky filled with soft, fluffy clouds. the eagle, with its feathers a mix of brown and white, is the central figure in this scene. in its powerful talons, it holds a bouquet of pink carnations, their vibrant color contrasting beautifully with the eagle's earthy tones. the bouquet is composed of several flowers, their petals spread out as if they are being carried by the wind. the background is a serene blend of pink and orange hues, suggesting either a sunrise or sunset. the overall scene is one of grace and power, as the eagle, with its prey, soars through the sky.\n",
"VAE scaling_factor = 1.0\n",
"384 256 A detailed black and white line drawing of a fish, depicted in a side view, showcasing its full body. The fish's mouth is closed, and it appears to be swimming, as indicated by the flowing lines that represent its tail. The background is a stark white, contrasting with the intricate details of the fish's scales and fins. The drawing style is reminiscent of a tattoo sketch, with fine lines that capture the texture and form of the fish.\n",
"VAE scaling_factor = 1.0\n",
"384 256 A young girl with vibrant orange hair and bright blue-green eyes, wearing a playful green shirt adorned with pink and white animal prints, and a simple, uncluttered background.\n",
"VAE scaling_factor = 1.0\n",
"384 256 A close-up portrait of a shaggy, brown and black Airedale Terrier dog, looking directly at the camera with a calm and attentive expression. The dog's fur is well-groomed and appears soft and fluffy. The background is a solid, dark blue, providing a stark contrast to the dog's light-colored fur. The lighting is soft and even, highlighting the dog's features without casting harsh shadows.\n",
"VAE scaling_factor = 1.0\n",
"384 384 In the heart of a bustling city, a young man with short black hair and glasses stands out. His attire is casual, with a black jacket and a gray shirt, and he carries a black bag. His gaze is directed towards the viewer, his expression serious and his fists clenched, suggesting a sense of determination or perhaps concern. The city around him is alive with activity, with other people visible in the background, their faces blurred and indistinct. The buildings tower above them, their details softened by distance. The scene is a blend of urban life and individual focus, capturing a moment of quiet intensity amidst the city's constant motion.\n",
"VAE scaling_factor = 1.0\n",
"192 384 zero: A majestic castle stands atop a rocky outcrop, its intricate architecture and lush forest surroundings evoking a sense of tranquility and awe.\n",
"VAE scaling_factor = 1.0\n",
"384 192 A woman with long, dark hair stands majestically against a backdrop of a vast, blue sky dotted with fluffy white clouds. she is adorned in a vibrant blue dress that cascades down to the ground, its intricate patterns and designs suggesting a rich cultural heritage. the dress is embellished with a variety of jewelry, including a necklace and earrings, adding to her regal appearance. her arms are raised, as if she is embracing the sky or perhaps calling forth the wind. the woman's stance and the flowing fabric of her dress create a dynamic sense of movement, as if she is caught in a moment of pure, unbridled joy. a beautiful blend of realism and fantasy, capturing the essence of a moment frozen in time.\n",
"VAE scaling_factor = 1.0\n",
"384 384 A solitary figure sits in a futuristic room, lost in thought, as a swirling vortex of clouds and light beckons beyond a large circular window.\n",
"VAE scaling_factor = 1.0\n",
"384 384 A serene view of a french riviera villa. the villa, with its white facade and red roof, stands majestically on a cliff, overlooking the vast expanse of the mediterranean sea. the villa is adorned with a balcony and a garden, adding to its charm. the sky above is a clear blue, suggesting a beautiful day. the sea below is a deep blue, with a few boats visible on the water, adding life to the tranquil scene. the villa is nestled amidst lush greenery, with palm trees and other plants dotting the landscape. the overall scene is picturesque and idyllic, embodying the essence of the french riviera.\n",
"VAE scaling_factor = 1.0\n",
"384 384 A vibrant red rooster with a glossy sheen, its feathers a mix of deep red and fiery orange, struts confidently across a polished wooden floor. The bird's head is turned slightly to the side, its beady eyes meeting the viewer's gaze. The background is a blur of indistinct shapes and colors, suggesting a bustling environment, possibly a fashion show or similar event. The focus is solely on the rooster, its vivid color and detailed plumage standing out starkly against the muted tones of the setting.\n",
"VAE scaling_factor = 1.0\n",
"384 384 A surreal and vibrant scene where a person's face is merged with the body of a goldfish. the person's face, with its black hair and striking black eyes, is the central focus of the image. the goldfish, with its orange and white scales, is depicted in a dynamic pose, swimming upwards towards the viewer. the background is a rich tapestry of blue and gold tones, adorned with abstract shapes and patterns that add to the dreamlike quality of the artwork. the overall composition creates a striking contrast between the organic and inorganic elements, resulting in a visually captivating piece.\n",
"VAE scaling_factor = 1.0\n",
"384 384 A white staircase descends to a serene ocean view, surrounded by cascading flowers and distant mountains, creating a natural and organic atmosphere.\n",
"VAE scaling_factor = 1.0\n",
"384 256 A powerful female figure stands in the center, exuding an aura of strength and mystery. her long, dark hair cascades down her shoulders, contrasting with her pale skin. she is adorned in a black hooded cloak that billows around her, and a silver sword rests on her hip, its blade gleaming with a soft light. a skull, a symbol of her formidable presence, is emblazoned on her chest. her gaze is directed towards the viewer, her red eyes piercing through the darkness. the background is shrouded in shadows, punctuated by blue flames that flicker around her, casting an ethereal glow on her form. the overall composition of the image suggests a fantasy setting, possibly a scene from a story or a character from a video game.\n",
"VAE scaling_factor = 1.0\n",
"192 384 A futuristic cityscape at night, viewed from an elevated perspective. the city is densely populated with skyscrapers that stretch into the dark blue sky, their lights twinkling like stars against the backdrop of the night. the foreground is dominated by a large, circular, glowing platform, which seems to be a hub of activity or a central point within the city. the platform is surrounded by a network of walkways and pathways, suggesting a well-connected urban environment. the overall atmosphere is one of advanced technology and urban development, with a focus on the interplay between architecture and the natural environment.\n",
"VAE scaling_factor = 1.0\n",
"384 256 A confident young woman with striking features and bold style stands out in the city, her vibrant green eyes and red lips drawing attention as she gazes directly into the camera.\n",
"VAE scaling_factor = 1.0\n",
"384 256 A young woman with twin tails and ornate dress stands before a floral-adorned door, her calm expression inviting the viewer into a serene and magical world.\n",
"VAE scaling_factor = 1.0\n",
"256 384 A muscular man in a black leather jacket and sunglasses stands in a dimly lit hallway, exuding intensity and mystery.\n",
"VAE scaling_factor = 1.0\n",
"384 384 A futuristic, psychedelic interior space with metallic and reflective surfaces, curved shapes, and a vibrant color palette, evoking a sense of movement and fluidity.\n",
"VAE scaling_factor = 1.0\n",
"192 384 In a cyberpunk cityscape, a female character with purple hair and red eyes reclines on a couch, her black jacket open, revealing a midriff. She holds a handgun in her right hand, her fingerless gloves contrasting with the city's glow in the background.\n",
"VAE scaling_factor = 1.0\n",
"192 384 A captivating scene of a pink liquid in a state of dynamic motion. the liquid, appearing to be water, is captured in the midst of splashing, creating a sense of energy and movement. the droplets are scattered throughout the image, some larger and more prominent, while others are smaller and more subtle, adding depth and dimension to the scene.\n",
"\n",
"the background is a light pink hue, providing a soft contrast to the vibrant pink of the liquid. this color palette creates a harmonious balance between the elements, with the pink of the liquid standing out against the lighter background.\n",
"\n",
"devoid of any text or human presence, focusing solely on the abstract beauty of the liquid and its movement. the absence of any recognizable objects or characters allows the viewer to fully immerse themselves in the scene, appreciating the simplicity and elegance of the composition.\n",
"\n",
"overall, the image is a testament to the power of abstract art, using color, light, and motion to create a visually striking scene that is both dynamic and serene.\n",
"VAE scaling_factor = 1.0\n",
"384 256 zero: A minimalist linocut print of a cheetah's profile, rendered in pink and orange, with striking eyes and whiskers, set against a bold orange background.\n",
"VAE scaling_factor = 1.0\n",
"192 384 A sailboat glides across a tranquil body of water, its sails catching the warm glow of the setting sun. The boat's reflection dances on the water's surface, mirroring the vibrant hues of the sky. In the distance, the majestic pyramids of Giza stand tall against the backdrop of the orange and yellow sky, their ancient forms softened by the soft light of the sunset. The scene is framed by the silhouettes of palm trees, adding a touch of tropical charm to the landscape. The overall atmosphere is one of serene beauty, as the day gives way to night under the watchful gaze of the pyramids.\n",
"VAE scaling_factor = 1.0\n",
"384 384 Two figures in black armor, their faces hidden, stand vigilant in a dimly lit church, bathed in an ethereal glow from a distant window.\n",
"VAE scaling_factor = 1.0\n",
"192 384 A young woman with striking black hair and a nose piercing sits pensively on a stool in a vibrant arcade, surrounded by neon lights and classic arcade machines.\n",
"VAE scaling_factor = 1.0\n",
"256 384 A majestic creature that appears to be a stylized, anthropomorphic animal, possibly a tiger, standing against a white background. the creature is adorned with intricate jewelry and accessories, including a crown, earrings, and a necklace, suggesting a theme of fantasy or mythology. the animal's fur is a mix of orange and black, with a pattern that resembles a tiger's coat, and it has a long, flowing tail that ends in a tassel. the creature's posture is upright, with its front paws resting on its chest, and it gazes directly at the viewer, giving it a regal and commanding presence. the overall style of the image is detailed and illustrative, with a focus on the creature's design and the textures of its fur and accessories.\n",
"VAE scaling_factor = 1.0\n",
"192 384 zero: A dynamic illustration of a red-eyed warrior maiden wielding a katana, surrounded by a coiled dragon and bold red accents, with stylized Chinese text reading \"One Girl\".\n",
"VAE scaling_factor = 1.0\n",
"384 192 A young man with white hair and striking blue eyes, wearing a black jacket with red accents, a silver necklace, and round glasses. He has a silver chain necklace and a ring on his finger, and he's looking directly at the viewer with a slight smile.\n",
"VAE scaling_factor = 1.0\n",
"384 256 A surreal and dreamlike scene featuring a tall, modern building with a series of glass-walled staircases that ascend vertically. the building's structure is intricate, with multiple levels and a central core that appears to be a vertical garden or atrium. the staircases are adorned with a railing that matches the building's design, suggesting a seamless integration of architecture and interior design.\n",
"\n",
"the building is enveloped by a vibrant, ethereal cloud formation that is a mix of pink, orange, and white hues, giving the impression of a surreal sky. the clouds are dense and layered, creating a sense of depth and dimensionality. the sky itself is a gradient of blue tones, transitioning from a lighter shade at the top to a deeper hue near the horizon.\n",
"\n",
"the overall atmosphere of the image is one of otherworldly beauty and tranquility, with the building and its staircases serving as a focal point amidst the swirling clouds. the absence of any human presence or activity adds to the serene and contemplative mood of the scene. the image could be interpreted as a commentary on the relationship between architecture and nature, or perhaps as a visual metaphor for the journey of the human spirit.\n",
"VAE scaling_factor = 1.0\n",
"192 384 A close-up shot of a colorful stone collection featuring red, orange, yellow, blue, and black stones with unique patterns.\n",
"VAE scaling_factor = 1.0\n",
"192 384 A captivating view of a cybernetic planet, a spherical world teeming with intricate machinery and structures. the planet's surface is a complex network of buildings and systems, each with its own unique design and purpose. the buildings, varying in size and shape, are interconnected by a network of pathways and tubes, creating a sense of unity and harmony. \n",
"\n",
"the planet is not devoid of life, as evidenced by the presence of windows that punctuate the surface. these windows, likely serving as habitats for the planet's inhabitants, add a touch of organic life to the otherwise mechanical landscape. \n",
"\n",
"the planet is set against a stark black background, punctuated by the presence of stars. these celestial bodies, scattered across the sky, add a sense of depth and scale to the image, emphasizing the vastness of the planet and its surroundings. \n",
"\n",
"despite the absence of human figures, the image conveys a sense of loneliness, as if the planet is a solitary entity in the vast expanse of space. the image, therefore, not only showcases the beauty of a cybernetic planet but also evokes a sense of wonder and curiosity about the unknown.\n",
"VAE scaling_factor = 1.0\n",
"384 192 zero: In the center of a bustling cityscape, a young girl with blonde hair and animal ears stands confidently. Her attire is a mix of fantasy and steampunk elements, with a blue skirt that contrasts against her white shirt adorned with a black bowtie. A pair of black gloves rests on her hips, and a pouch hangs from her belt, ready for adventure. Her gaze is directed towards the viewer, and a slight blush graces her cheeks. The city around her is alive with activity, with other characters and objects adding depth to the scene.\n",
"VAE scaling_factor = 1.0\n",
"192 384 A close-up of a cluster of green apples hanging from a branch against a white background. The apples are glossy, suggesting they are fresh and possibly recently watered. The leaves are a vibrant green, indicating they are healthy. The lighting is soft and warm, enhancing the natural colors of the fruit and leaves.\n",
"VAE scaling_factor = 1.0\n",
"384 192 A stylized illustration of a woman with her head tilted down, her eyes closed, and a hand resting on her cheek. She wears a black top and large golden earrings. Her hair is dark and styled down. The background is black, and there are red and pink abstract shapes that resemble water or energy flowing around her.\n",
"VAE scaling_factor = 1.0\n",
"192 384 A man and a woman are captured in a moment of intimacy. the man, adorned with a tattoo on his neck, is wearing a black leather jacket and a gold chain necklace. his hair is styled in braids, adding to his rugged appearance. the woman, dressed in a black leather jacket and a red necklace, has her hair styled in a messy bun. they are both lying down, their heads resting on each other's shoulders, suggesting a close relationship. the background is a white tiled wall, providing a stark contrast to their dark attire. the image exudes a sense of tranquility and closeness.\n",
"VAE scaling_factor = 1.0\n",
"384 256 In the center of the image, a young woman with brown hair and brown eyes is standing in an office environment. She is dressed in a professional black suit and high heels, giving off an air of formality. Her hands are clasped together in front of her, and she is looking up, possibly at something or someone above her. The office setting is filled with various papers and a computer, suggesting a busy workday. The woman's expression is one of concern or worry, adding a layer of intrigue to the scene.\n",
"VAE scaling_factor = 1.0\n",
"384 256 A hooded figure stands poised on a snowy mountain peak, sword in hand, with intricate embroidery and a fur-trimmed hood, their dark eyes fixed intently on the viewer.\n",
"VAE scaling_factor = 1.0\n",
"384 256 A young woman with platinum blonde hair and striking blue eyes, wearing a traditional Japanese kimono adorned with a floral pattern, stands outdoors. She is smiling and looking directly at the viewer, exuding a sense of warmth and charm. The kimono is complemented by a purple obi sash, adding a pop of color to her attire. The background features a serene garden setting with a red lantern, contributing to the overall tranquil ambiance of the scene.\n",
"VAE scaling_factor = 1.0\n",
"256 384 A captivating scene of a white sheet of paper suspended in mid-air, surrounded by a lush array of plants and moss. the paper, which is the central focus of the image, is held up by thin metal threads, creating a sense of levitation. the plants, a mix of vibrant green and yellow hues, are arranged in a way that they frame the paper, adding depth and dimension to the scene. the moss, with its delicate texture, adds an element of softness to the overall composition. the background is a stark contrast to the foreground, with a black wall providing a dramatic backdrop that makes the white paper and the colorful plants stand out even more. taken from a low angle, which enhances the sense of height and grandeur of the scene. the overall composition is balanced and harmonious, with each element playing its part in creating a visually appealing image.\n",
"VAE scaling_factor = 1.0\n",
"192 384 In the heart of a bustling cyberpunk city, a group of characters stand out against the backdrop of towering skyscrapers. The cityscape is alive with activity, with cars and trucks navigating the streets and pedestrians going about their day. The sky above is a clear blue, dotted with fluffy white clouds, providing a stark contrast to the urban jungle below. The architecture is a mix of modern and futuristic designs, with billboards and advertisements adorning the buildings, adding to the vibrant city atmosphere. The characters, each with their unique attire and accessories, add a touch of individuality to the scene. The overall image is a blend of technology, fashion, and urban life, captured in a single, dynamic frame.\n",
"VAE scaling_factor = 1.0\n",
"384 256 A lively gathering of dogs of various breeds and sizes, all looking directly at the viewer with their tongues out, set against a vibrant blue background.\n",
"VAE scaling_factor = 1.0\n",
"384 256 In the center of a dark, starlit sky, a majestic creature with the body of a wolf and the head of a human stands in a pose of quiet contemplation. The creature's fur is a rich, dark brown, and its eyes glow with a piercing yellow light. Adorning its head are two large, pointed ears that taper to a sharp point, and a crown of gold and blue jewels rests atop its head, adding to its regal appearance. The creature's hands are clasped together in front of it, and its gaze is directed towards the viewer, creating an intimate connection. The background is a stark contrast to the creature, with a black background punctuated by gold and blue geometric patterns that add depth and intrigue to the scene.\n",
"VAE scaling_factor = 1.0\n",
"256 384 A serene path is illuminated by willow trees with shimmering wax-covered branches, surrounded by waxy leaves and molten wax, evoking a tranquil and dreamlike atmosphere.\n",
"VAE scaling_factor = 1.0\n",
"192 384 A charming character with a unique blend of human and fox features. the character is depicted in four distinct poses, each showcasing a different angle and expression. the character's attire is a vibrant orange jacket, which contrasts beautifully with the white background. the character's hair is a rich brown color, and their eyes are a striking amber color. adding to the character's charm are their fox ears and tail, which are a light brown color. the character's expressions vary from playful to contemplative, adding depth to the character's personality. the overall illustration is lively and detailed, making the character appear quite endearing.\n",
"VAE scaling_factor = 1.0\n",
"384 256 A young male character with a muscular build, showcasing a well-defined eight-pack abs. he has short brown hair and striking green eyes. the character is dressed in a casual outfit consisting of a white hoodie and gray pants. the hoodie is draped over his shoulder, revealing his torso, and the pants are slightly pulled down to reveal his muscular thighs. the background is softly lit, with a warm glow emanating from a window, casting a gentle light on the character's face and upper body. the overall style of the image is reminiscent of anime-inspired character designs, with a high level of detail and shading that brings the character to life.\n",
"VAE scaling_factor = 1.0\n",
"384 256 A young female character with a unique and vibrant appearance. she has short, pink hair with a gradient that transitions to a darker shade at the tips, and her eyes are a striking pink color. her ears are adorned with small, delicate earrings, and she wears a black choker around her neck. she is dressed in a white hoodie with pink strings, which is open to reveal a black one-piece swimsuit underneath. the hoodie's sleeves are long, and the jacket has a zipper running down the front. the background is a soft, blurred light blue, providing a contrast to the character's colorful attire. the character is looking directly at the viewer, giving the impression of a direct engagement with the viewer.\n",
"VAE scaling_factor = 1.0\n",
"384 192 A young boy with short black hair and brown eyes stands confidently with his hands in his pockets. He is dressed in a white t-shirt, yellow shorts, and blue sneakers, exuding a sense of casual style. The boy's cheerful expression adds a warm and inviting aura to the image. The background is a simple, clean green, which contrasts nicely with the boy's outfit and allows him to be the focal point of the image.\n",
"VAE scaling_factor = 1.0\n",
"384 192 A black sheep stands majestically on a grassy hill, its woolly coat contrasting with the vibrant green grass, gazing directly into the camera.\n",
"VAE scaling_factor = 1.0\n",
"384 384 In the heart of a futuristic spaceship, a female pilot with striking red and black skin stands at the helm. Her attire, a dark hooded cloak, contrasts with the sleek black interior of the cockpit. The ship's controls, a mix of red and black, are at her fingertips, ready for the journey ahead. The cockpit is bathed in a soft glow, casting an ethereal light on the pilot's face. Through the windows, the vast expanse of space stretches out, a testament to the endless possibilities that lie ahead.\n",
"VAE scaling_factor = 1.0\n",
"384 256 In the heart of a vibrant rainforest, a waterfall cascades down a towering cliff, its light illuminating the surrounding foliage. The sky above is a canvas of deep blues, punctuated by the fiery glow of lightning and the sparkling trails of shooting stars. The forest is alive with the rustling of leaves and the chirping of unseen creatures. A group of adventurers, armed with torches, navigate the rocky terrain, their figures silhouetted against the backdrop of the waterfall. The scene is one of adventure and wonder, a testament to the beauty and mystery of nature.\n",
"VAE scaling_factor = 1.0\n",
"384 256 A surreal scene of a tree-like structure, adorned with various objects and plants, set against a backdrop of a serene landscape. the tree, with its gnarled trunk and branches, is the central focus of the image. it is covered in a dense layer of green moss, giving it a vibrant and lush appearance. \n",
"\n",
"perched atop the tree is a large, metallic sculpture of a humanoid figure. the figure is seated, with its arms and legs extended outward, as if it is in a state of repose. the sculpture is intricately detailed, with a shiny, reflective surface that catches the light.\n",
"\n",
"the tree is not just a canvas for the sculpture; it is also a display for an array of objects. these include a collection of white buckets, each with a vibrant orange handle, and a stack of white plastic chairs. the buckets and chairs are scattered across the tree, adding to the eclectic mix of objects.\n",
"\n",
"the background of the image reveals a tranquil landscape. a field stretches out, dotted with trees and bushes. the sky above is a clear blue, suggesting a bright, sunny day. the overall scene is one of tranquility and surreal beauty, with the tree and its adornments serving as a striking centerpiece.\n",
"VAE scaling_factor = 1.0\n",
"384 384 A stone pathway leads through an archway in a traditional Greek island setting, with a blue door on the left and a white dome structure visible in the distance.\n",
"VAE scaling_factor = 1.0\n",
"256 384 There is a young woman with red eyes and black hair, wearing a red beret and a red jacket with fur trim. she is also wearing thigh-high black boots with red ribbons. she is holding a brown teddy bear and is smiling at the viewer. the woman is sitting on a bench in a city street, with traffic lights and buildings in the background. the sky is clear and blue, suggesting it is daytime. the woman appears to be enjoying her time outdoors.\n",
"VAE scaling_factor = 1.0\n",
"256 384 In the quiet solitude of a snowy night, a solitary figure stands on a frozen lake, their silhouette a stark contrast against the pale blue of the ice. The lamppost, standing sentinel on the left, casts a warm glow that dances on the frosty surface. Beyond the lake, a cityscape unfolds, its buildings shrouded in a mist that obscures their details. Towering wind turbines pierce the fog, their blades still in the calm of the night. The city's lights twinkle like distant stars, their glow reflected in the water. The scene is one of tranquility and mystery, a moment frozen in time amidst the hustle and bustle of urban life.\n",
"VAE scaling_factor = 1.0\n",
"384 384 A 3D rendered image of a cute, fluffy lynx kitten with big, half-shut eyes, looking sleepy and wearing forest-themed pajamas, in a snowy woodland clearing with gentle snowfall.\n",
"VAE scaling_factor = 1.0\n",
"384 192 A vibrant pink beach towel, seemingly floating in the vast emptiness of deep space, with a backdrop of twinkling stars and a dark, starlit sky.\n",
"VAE scaling_factor = 1.0\n",
"384 384 A samurai stands poised against a backdrop of a full moon, its fiery orange hues casting a warm glow on the scene. the samurai, adorned in a black kimono, holds a katana in its right hand, the blade gleaming under the moonlight. its long, flowing hair, a mix of black and orange, billows in the wind, adding a dynamic element to the composition. the samurai's stance is one of readiness, its body angled towards the viewer, suggesting an imminent action. the night sky is filled with sparks, their bright colors contrasting with the dark silhouette of the samurai. the overall atmosphere is one of anticipation and power, as if the samurai is about to draw its katana and charge into battle.\n",
"VAE scaling_factor = 1.0\n",
"384 256 A young boy with short black hair and a grey shirt stands against a white background. He is smiling and looking directly at the viewer, with a blush on his cheeks. His hair is tousled and his eyes are wide open, giving him a friendly and approachable demeanor.\n",
"VAE scaling_factor = 1.0\n",
"384 256 A young girl with mint blue hair and blue eyes stands on a shopping street, holding a Starbucks cup and wearing a star-adorned jacket, with a reserved expression.\n",
"VAE scaling_factor = 1.0\n",
"384 384 A muscular male elf warrior with a beard stands alongside a rainbow-scaled dragon in a dark, high-fantasy environment, rendered in digital art with intense expressions.\n",
"VAE scaling_factor = 1.0\n",
"384 384 A young girl stands barefoot, surrounded by hooded figures with weapons, their faces obscured by shadows, amidst a backdrop of rough stone walls and eerie tranquility.\n",
"VAE scaling_factor = 1.0\n",
"384 256 A young woman with blonde hair, blue eyes, and a blue dress gazes directly at the viewer with a subtle blush on her cheeks.\n",
"VAE scaling_factor = 1.0\n",
"384 256 A bald, blue-skinned figure with striking black and red attire stands out, arms outstretched and fingers forming a spell-like shape, surrounded by swirling patterns of light and shadow.\n",
"VAE scaling_factor = 1.0\n",
"384 256 In the serene setting of a rural landscape, a young girl finds solace on a wooden bench, her long hair cascading down her shoulders. She's dressed in a vibrant red skirt, a stark contrast to the lush greenery that surrounds her. Her gaze is directed towards the distance, perhaps lost in thought or simply enjoying the view.\n",
"\n",
"Beside her, a small dog is peacefully sleeping, oblivious to the world around it. The bench is nestled under the shade of an old oak tree, its branches reaching out as if to protect the girl and her canine companion.\n",
"\n",
"A bicycle leans casually against the tree, its presence adding a touch of adventure to the scene. The path leading up to the bench is made of gravel, worn by the passage of time and the feet of those who tread it.\n",
"\n",
"In the background, a wooden shelter stands as a silent sentinel, its rustic charm blending seamlessly with the rural setting. Beyond it, rolling hills stretch out into the distance, their slopes dotted with houses that are too small to discern any specific details.\n",
"\n",
"Above it all, the sky is a canvas of blue, dotted with fluffy white clouds that add depth to the scene. The sun shines brightly, casting dappled sunlight and shadows that dance across the landscape, creating a sense of tranquility and peace.\n",
"VAE scaling_factor = 1.0\n",
"192 384 A person's tear-streaked face, partially hidden by their hand, is captured in a blurred motion through a rain-streaked window, conveying sadness and contemplation.\n",
"VAE scaling_factor = 1.0\n",
"384 256 zero: A young woman stands strong and courageous, her dark armor adorned with gemstones, sword at the ready, her piercing gaze challenging the stormy night.\n",
"VAE scaling_factor = 1.0\n",
"384 256 A young male character with blonde hair and striking blue eyes, wearing a detailed blue and gold armor set. The armor is intricately designed with a prominent emblem on the chest, and the character's expression is serious. The background is a soft, white gradient, and the lighting highlights the armor's details and the character's features.\n",
"VAE scaling_factor = 1.0\n",
"384 384 A young man sits at a table, gazing out the window, surrounded by books and a potted plant, with a cup of coffee in hand.\n",
"VAE scaling_factor = 1.0\n",
"384 384 In the heart of a serene garden, two adorable chicks stand side by side, their fluffy feathers a soft contrast against the vibrant greenery. The chick on the left, with its head tilted to the side, gazes directly into the camera, its eyes sparkling with joy. Its companion, on the right, has its head gently resting on the other's back, a picture of contentment. Their cheeks are flushed, suggesting a moment of shared happiness or perhaps a playful interaction. The background is a blur of colors, hinting at the lush garden setting, with delicate flowers adding a touch of whimsy to the scene. The chicks' positions and expressions suggest a moment of affection and camaraderie.\n",
"VAE scaling_factor = 1.0\n",
"384 192 Pink roses, glistening with raindrops, rest on a wet street at night, surrounded by the soft glow of distant lanterns and city lights.\n",
"VAE scaling_factor = 1.0\n",
"384 384 A striking black and white illustration of a character in a dynamic pose, with clenched fists and teeth, exuding a sense of intense anger and agitation. The character's gaze is directed towards the viewer, adding a direct and confrontational element to the image.\n",
"VAE scaling_factor = 1.0\n",
"384 256 In the center of the image, a man with a stern expression stands with his arms crossed, wearing a bandana and a red jacket. He is positioned in front of a large, towering structure that appears to be a factory or industrial complex. The structure is adorned with pipes and machinery, and it emits a plume of smoke that rises into the sky. The sky itself is a dramatic backdrop, with clouds and a gradient of colors suggesting either a sunrise or sunset. The overall atmosphere is one of intensity and focus, with the man seemingly guarding the industrial behemoth behind him.\n",
"VAE scaling_factor = 1.0\n",
"384 384 A collection of concept art illustrations featuring a character standing amidst various plant species. the character, who appears to be a female with brown hair, is dressed in a brown outfit and is holding a rifle. she is positioned in the center of the image, with the plants surrounding her. the plants vary in color and shape, with some displaying vibrant yellow and orange hues, while others are more subdued in color. the background is a simple, white canvas that allows the plants and the character to stand out. the style of the image is illustrative, with a focus on the character and the plants, and the overall composition suggests a theme of exploration or survival in a natural environment.\n",
"VAE scaling_factor = 1.0\n",
"384 192 A striking female character with a fantasy-inspired aesthetic. her hair is a vibrant shade of black, adorned with a floral arrangement of red and yellow roses. her eyes, a striking shade of yellow, are accentuated with dramatic makeup, including long eyelashes and a bold red lipstick. \n",
"\n",
"she has a distinctive tattoo of a skull on her left arm, adding to her edgy appearance. a pair of earrings, possibly gold in color, dangle from her ears. her attire consists of a black tank top, which contrasts with the colorful floral elements in her hair and the red roses that are scattered throughout the image.\n",
"\n",
"the background is a blend of blue and gray tones, with splashes of red roses adding a pop of color. the overall composition of the image suggests a blend of fantasy and fashion, with the character's unique style and the artistic elements creating a visually captivating scene.\n",
"VAE scaling_factor = 1.0\n",
"256 384 A blue-haired stormtrooper sits at a cozy bar, her piercing gaze directed at the viewer, surrounded by warm orange hues and well-stocked bottles.\n",
"VAE scaling_factor = 1.0\n",
"384 192 A wooden sculpture of a humanoid figure with a stylized face and body, standing upright against a plain white background. The figure is adorned with a patterned kimono, featuring a combination of dark and light wood tones. The sculpture's design is intricate, with a focus on the geometric patterns and textures of the wood.\n",
"VAE scaling_factor = 1.0\n",
"384 192 A young boy with blue eyes is jumping in the air, wearing a brown hat and a matching brown jacket and pants. He has a wide smile on his face and his arms are raised in excitement. He is carrying a black bag and has black boots on. The background is a solid yellow color.\n",
"VAE scaling_factor = 1.0\n",
"192 384 In the heart of a bustling city, a whimsical scene unfolds. A large, furry creature with a mischievous grin and antlers stands proudly, its gaze fixed directly on the viewer. The creature is adorned with a wreath of green leaves, adding a touch of nature to its fantastical appearance. It holds a stack of brown cardboard boxes, each bearing the unmistakable logo of Amazon. The boxes are tied together with gold ribbon, suggesting a festive occasion or perhaps a playful delivery. The creature is positioned in front of a building, its presence contrasting with the urban backdrop. The cityscape includes a Christmas tree, hinting at the holiday season. The creature's position and the boxes it holds suggest it might be delivering presents, adding a touch of magic to the everyday hustle and bustle of the city.\n",
"VAE scaling_factor = 1.0\n",
"384 256 A striking visual of a black, anatomical heart encased in a clear, transparent cage. the heart, with its intricate details and realistic texture, is the central focus of the image. it appears to be floating in a dark, underwater environment, as suggested by the presence of bubbles and the icy texture of the water. the cage, which is transparent, allows for a clear view of the heart, enhancing its prominence in the scene. the monochromatic color scheme adds a dramatic and somewhat eerie quality to the image.\n",
"VAE scaling_factor = 1.0\n",
"384 384 A stylized illustration of a woman with dark skin, curly hair, and bold accessories, showcasing her from three angles, with a focus on fashion and urban aesthetics.\n",
"VAE scaling_factor = 1.0\n",
"384 256 A Halloween-themed landscape sticker featuring a spooky house with glowing windows, surrounded by bats, pumpkins, and a full moon.\n",
"VAE scaling_factor = 1.0\n",
"384 384 A young woman with red hair and blue eyes, wearing a plaid dress with long sleeves and a white collar, holds a magnifying glass in her right hand. She is looking directly at the camera with a slight smile. The background features a floral pattern.\n",
"VAE scaling_factor = 1.0\n",
"192 384 A vibrant and serene tropical resort nestled on a sandy beach. the resort is a multi-story structure with a distinctive red roof, surrounded by lush greenery and towering palm trees. the architecture of the resort is reminiscent of a spanish colonial style, with its curved roofs and ornate details. the sky above is a clear blue, dotted with fluffy white clouds, suggesting a bright and sunny day. the ocean, a deep turquoise, gently laps against the shore, adding to the tranquil atmosphere. the overall scene is highly detailed and realistic, capturing the essence of a luxurious caribbean getaway.\n",
"VAE scaling_factor = 1.0\n",
"384 256 In the center of the image, a woman with striking red eyes and gray hair stands out. she is adorned in a unique dress that is both elegant and macabre, featuring a skeleton design. the dress is embellished with intricate lace and delicate white flowers, adding a touch of femininity to the otherwise stark ensemble. a veil, also made of lace, drapes down her back, complementing her attire. \n",
"\n",
"she is wearing a helmet that is equally as captivating, with a floral design that mirrors the flowers on her dress. the helmet is held in place by a white ribbon, which is tied in a bow at the back of her head. \n",
"\n",
"the woman's gaze is directed towards the viewer, creating a sense of connection. her expression is serene, with a slight smile playing on her lips. the background is blurred, drawing focus to the woman and her unique attire. the overall color palette is dominated by shades of white and gray, with the red of her eyes providing a striking contrast. \n",
"\n",
"rich in detail, from the crisp lines of the skeleton dress to the delicate petals of the flowers. the high-contrast shading adds depth to the image, making the woman and her attire stand out even more. the style of the image is reminiscent of anime, with its attention to detail and vibrant colors.\n",
"VAE scaling_factor = 1.0\n",
"384 384 A detailed architectural poster of a four-story prefabricated concrete housing complex. the design is inspired by le corbusier's unité d'habitation, and the poster is rendered in black lines on a white background, emphasizing precision and structure. the main structure of the building is a concrete housing complex with clean lines, geometric shapes, and a modular design. large, floor-to-ceiling wooden windows are featured throughout the facade, providing a contrast to the concrete elements. the poster includes two additive floor plans, a building section, and an axonometric view, all detailed to scale with dimensions and labels. the background is a symmetrical grid of precise black lines on a white background, serving as a backdrop and enhancing the sense of order and precision. the architectural features of the building include pilotis (support columns), flat roof terraces, and open floor plans. the text elements are minimalist, sans-serif, and include the project name, design inspiration, and key features.\n",
"VAE scaling_factor = 1.0\n",
"384 192 A blonde woman with green eyes and a slight smile looks to the side, wearing a black leather jacket.\n",
"VAE scaling_factor = 1.0\n",
"384 256 A young girl with long hair is seen from behind, running on a balcony with a white dress on. She is barefoot and appears to be enjoying the view of the ocean and the boats in the distance. The balcony overlooks a picturesque seaside town with buildings and potted plants. The sky is partly cloudy, and the overall scene suggests a sunny day.\n",
"VAE scaling_factor = 1.0\n",
"384 256 A solitary figure stands atop a hill, silhouetted against the starry sky, its golden hues and twinkling lights casting a dramatic glow.\n",
"VAE scaling_factor = 1.0\n",
"384 256 In the center of the image, a muscular male figure with blue hair and white gloves is captured in a dynamic pose. His eyes are focused, and his mouth is open as if he is shouting or breathing heavily. He is surrounded by a large blue energy wave that radiates from his hands, suggesting he is in the midst of a powerful attack. The background is filled with rocks and debris, indicating a chaotic and explosive environment. The overall style of the image is reminiscent of a comic book or an animated series, with vibrant colors and dramatic action.\n",
"VAE scaling_factor = 1.0\n",
"384 384 In the heart of a dark, mystical realm, a knight stands resolute, embodying the essence of valor and honor. The knight, clad in a suit of black armor, is a spectacle to behold. The armor, intricately designed, is adorned with red accents that contrast sharply against the knight's dark attire. A red cape, flowing behind him, adds to the dramatic effect. \n",
"\n",
"In his right hand, he wields a massive sword, its blade gleaming with a fierce red hue that matches his cape. The sword, held high, is a symbol of his readiness for battle. His left hand is firmly gripping a shield, its surface a deep red, mirroring the color of his cape and sword.\n",
"\n",
"The knight is set against a backdrop of a dark, ominous landscape. The ground beneath him is a stark contrast to the darkness, painted in a deep red that echoes the colors of his armor and weapons. The scene is further enhanced by the presence of red sparks and flames that dance around him, adding to the mystical and otherworldly atmosphere.\n",
"\n",
"Every element in this image comes together to create a scene that is both visually striking and narratively intriguing. The knight, with his vibrant attire and imposing presence, is the undeniable focal point of this image. The surrounding darkness and the red sparks and flames add depth and complexity to the scene, inviting the viewer to imagine the story behind this moment captured in time.\n",
"VAE scaling_factor = 1.0\n",
"384 256 A quaint, fantasy-themed café nestled in a charming setting. the café's exterior is adorned with a variety of potted plants, adding a touch of greenery to the scene. a wooden sign with a lantern hangs above the entrance, inviting passersby to step in. the café's menu board is visible, suggesting a range of offerings for patrons. a small table with a cup and a vase of flowers is set up outside, possibly for customers to enjoy their beverages in the open air. the overall atmosphere is one of warmth and hospitality, inviting one to sit down and enjoy a moment of respite.\n",
"VAE scaling_factor = 1.0\n",
"384 384 A vibrant and intricate tilework design. the central focus is a large, ornate flower with a yellow center, surrounded by a symmetrical pattern of blue and white swirls and floral motifs. the border of the tilework is adorned with a repeating pattern of yellow flowers and leaves, adding a touch of elegance to the overall design. the background of the tilework is a deep blue, providing a striking contrast to the lighter elements of the design. the craftsmanship of the tilework suggests a traditional style, possibly inspired by the rich history of tile art in regions like the cartuja de sevilla.\n",
"VAE scaling_factor = 1.0\n",
"192 384 A dynamic, flowing representation of orange juice surrounds a prominent orange slice, evoking freshness and vitality.\n",
"VAE scaling_factor = 1.0\n",
"384 256 A young man in a formal suit with a patterned tie and floral jacket looks directly at the viewer with a slight smile.\n",
"VAE scaling_factor = 1.0\n",
"384 256 A young woman with long blonde hair and gold eyes sits on a throne, her expression calm and collected. She is adorned with dragon horns on her head, adding an element of fantasy to her appearance. The background is dark and moody, with a hint of a dragon's presence, suggesting a narrative of power and mystique. The art style is reminiscent of traditional oil painting, with a focus on realistic detail and a rich color palette. The use of chiaroscuro woodcuts and the solarization effect adds depth and texture to the image. The overall composition is layered and complex, with a sense of movement and energy.\n",
"VAE scaling_factor = 1.0\n",
"384 384 A close-up portrait of a young woman with brown hair and pointed ears, looking directly at the camera. She is wearing a gold necklace with a pendant and has a subtle, elegant makeup style. The background is softly lit, suggesting an indoor setting with a hint of a castle-like architecture.\n",
"VAE scaling_factor = 1.0\n",
"384 384 A woman with long, flowing hair is immersed in a cosmic scene. her eyes are gently closed, and her lips are slightly parted, as if she is in a state of deep meditation or contemplation. the woman's face is illuminated by a soft, ethereal light that seems to emanate from her own skin, casting a gentle glow on her features.\n",
"\n",
"the background is a vast expanse of deep indigo, reminiscent of a starless night sky. however, this is not a typical night sky; it is filled with swirling patterns of light and energy that resemble the paths of celestial bodies. these patterns are intricate and complex, with strands of light intertwining and flowing around the woman.\n",
"\n",
"the woman's hands are extended towards the center of the image, where a large, luminous sphere of light is suspended. this sphere is a radiant yellow-orange color, and it seems to be the focal point of the woman's attention. the sphere is surrounded by smaller, glowing orbs that appear to be floating in the space around it.\n",
"\n",
"the overall style of the image is reminiscent of a surreal oil painting, with a high level of detail and a dreamlike quality. the use of light and color is exquisite, with the dark indigo of the background contrasting sharply with the luminous spheres and the woman's glowing skin. a testament to the artist's skill in creating a scene that is both visually stunning and thought-provoking.\n",
"VAE scaling_factor = 1.0\n",
"Images generated and saved to: samples\n"
]
}
],
"source": [
"import torch\n",
"from datasets import load_from_disk\n",
"from diffusers import AutoencoderKL, UNet2DConditionModel, FlowMatchEulerDiscreteScheduler\n",
"from transformers import AutoTokenizer, AutoModel\n",
"from PIL import Image\n",
"import math\n",
"from tqdm.auto import tqdm\n",
"import os\n",
"import random\n",
"\n",
"import numpy as np\n",
"import random\n",
"\n",
"import torch\n",
"\n",
"from diffusers import DiffusionPipeline, AutoencoderKL, UNet2DConditionModel, FlowMatchEulerDiscreteScheduler\n",
"from transformers import AutoTokenizer, AutoModel\n",
"\n",
"device = \"cuda\" if torch.cuda.is_available() else \"cpu\"\n",
"model_repo_id = \"AiArtLab/sdxs3d\" # Replace to the model you would like to use\n",
"\n",
"# Initialize models and tokenizer\n",
"device = \"cuda\" if torch.cuda.is_available() else \"cpu\"\n",
"dtype = torch.float16 if torch.cuda.is_available() else torch.float32\n",
"\n",
"\n",
"class SimpleDiffusionPipeline(DiffusionPipeline):\n",
" def __init__(self, vae, text_encoder, tokenizer, unet, scheduler):\n",
" super().__init__()\n",
" self.register_modules(\n",
" vae=vae,\n",
" text_encoder=text_encoder,\n",
" tokenizer=tokenizer,\n",
" unet=unet,\n",
" scheduler=scheduler,\n",
" )\n",
"\n",
" @torch.no_grad()\n",
" def __call__(\n",
" self,\n",
" prompt,\n",
" negative_prompt=None,\n",
" height=512,\n",
" width=512,\n",
" num_inference_steps=50,\n",
" guidance_scale=4.0,\n",
" generator=None,\n",
" **kwargs,\n",
" ):\n",
" batch_size = len(prompt) if isinstance(prompt, list) else 1\n",
"\n",
" # 1. Токенизация\n",
" toks = self.tokenizer(\n",
" prompt,\n",
" padding=\"max_length\",\n",
" truncation=True,\n",
" max_length=512,\n",
" return_tensors=\"pt\"\n",
" ).to(self.device)\n",
"\n",
" outs = self.text_encoder(**toks)\n",
" text_emb = outs.last_hidden_state[:, -1].unsqueeze(1) # твой last_token_pool\n",
"\n",
" if negative_prompt is not None:\n",
" neg_toks = self.tokenizer(\n",
" negative_prompt,\n",
" padding=\"max_length\",\n",
" truncation=True,\n",
" max_length=512,\n",
" return_tensors=\"pt\"\n",
" ).to(self.device)\n",
" neg_outs = self.text_encoder(**neg_toks)\n",
" neg_emb = neg_outs.last_hidden_state[:, -1].unsqueeze(1)\n",
" else:\n",
" neg_emb = torch.zeros_like(text_emb)\n",
"\n",
" # guidance\n",
" if guidance_scale != 1.0:\n",
" text_emb = torch.cat([neg_emb, text_emb])\n",
"\n",
" # 2. Латенты\n",
" print(\"VAE scaling_factor =\", vae.config.scaling_factor)\n",
"\n",
" latents = torch.randn(\n",
" (batch_size, self.unet.config.in_channels, int(height / 8), int(width / 8),),\n",
" device=self.device,\n",
" dtype=torch.float16,\n",
" generator=generator,\n",
" )\n",
"\n",
" self.scheduler.set_timesteps(num_inference_steps, device=self.device)\n",
"\n",
" # 3. Диффузия\n",
" for t in self.scheduler.timesteps:\n",
" latent_input = torch.cat([latents, latents]) if guidance_scale != 1.0 else latents\n",
" flow = self.unet(latent_input, t, encoder_hidden_states=text_emb).sample\n",
"\n",
" if guidance_scale != 1.0:\n",
" flow_uncond, flow_cond = flow.chunk(2)\n",
" flow = flow_uncond + guidance_scale * (flow_cond - flow_uncond)\n",
"\n",
" latents = self.scheduler.step(flow, t, latents).prev_sample\n",
"\n",
" # 4. Декод\n",
" #latents = latents / self.vae.config.scaling_factor\n",
" images = self.vae.decode(latents).sample\n",
" images = (images / 2 + 0.5).clamp(0, 1)\n",
"\n",
" return images\n",
"\n",
"def get_random_samples(dataset_path, num_samples=20):\n",
" \"\"\"\n",
" Возвращает случайные тексты, ширину и высоту из датасета.\n",
" \"\"\"\n",
" # Загружаем датасет\n",
" dataset = load_from_disk(dataset_path)\n",
"\n",
" # Удаление записей с \"vectorstock\"\n",
" filtered_indices = [i for i, text in enumerate(dataset['text']) if 'vector' not in text.lower()]\n",
" dataset = dataset.select(filtered_indices)\n",
"\n",
" # Выбираем случайные индексы\n",
" random_indices = random.sample(range(len(dataset)), num_samples)\n",
"\n",
" # Извлекаем тексты, ширину и высоту\n",
" samples = [\n",
" {\n",
" \"text\": dataset[i]['text'],\n",
" \"width\": dataset[i]['width'],\n",
" \"height\": dataset[i]['height']\n",
" }\n",
" for i in random_indices\n",
" ]\n",
"\n",
" return samples\n",
"\n",
"vae = AutoencoderKL.from_pretrained(model_repo_id, subfolder=\"vae\", torch_dtype=dtype).to(device)\n",
"unet = UNet2DConditionModel.from_pretrained(model_repo_id, subfolder=\"unet\", torch_dtype=dtype).to(device)\n",
"tokenizer = AutoTokenizer.from_pretrained(model_repo_id, subfolder=\"tokenizer\")\n",
"text_encoder = AutoModel.from_pretrained(model_repo_id, subfolder=\"text_encoder\", torch_dtype=dtype).to(device)\n",
"scheduler = FlowMatchEulerDiscreteScheduler.from_pretrained(model_repo_id, subfolder=\"scheduler\")\n",
"\n",
"pipe = SimpleDiffusionPipeline(\n",
" vae=vae,\n",
" text_encoder=text_encoder,\n",
" tokenizer=tokenizer,\n",
" unet=unet,\n",
" scheduler=scheduler,\n",
").to(device)\n",
"\n",
"def generate_and_save_images(dataset_path, output_folder=\"samples\", project_name=\"sdxs\"):\n",
" # Load random samples\n",
" samples = get_random_samples(dataset_path,num_samples=100)\n",
"\n",
" os.makedirs(output_folder, exist_ok=True)\n",
" generator = torch.Generator(device=device).manual_seed(42) \n",
"\n",
" for idx, sample in enumerate(samples):\n",
" prompt = sample[\"text\"]\n",
" negative_prompt = \"bad quality, low quality, low resolution\"\n",
" height, width = sample[\"height\"], sample[\"width\"]\n",
" print(height, width,prompt)\n",
" images_tensor = pipe(\n",
" prompt=prompt,\n",
" negative_prompt=negative_prompt,\n",
" width=width,\n",
" height=height,\n",
" generator = generator\n",
" ) # [B, C, H, W]\n",
"\n",
" # Конвертация в numpy для Gradio\n",
" image = images_tensor[0].cpu().permute(1, 2, 0).numpy()\n",
" image = (image * 255).astype(np.uint8)\n",
" image = Image.fromarray(image)\n",
" image.save(f\"{output_folder}/{project_name}_{idx}.jpg\")\n",
"\n",
" print(\"Images generated and saved to:\", output_folder)\n",
"\n",
"# Example usage\n",
"dataset_path = \"/workspace/sdxs3d/datasets/mjnj\"\n",
"generate_and_save_images(dataset_path)\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "83264143-936c-4f1b-8d89-75e19253d636",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.3"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
|