Spaces:
Running
Running
Sean Powell commited on
Commit ·
22facc4
1
Parent(s): 98271f9
Tweak params and prompts for diamond-crop-img2img.
Browse files
experiments/diamond-crop-img2img.py
CHANGED
|
@@ -1,25 +1,33 @@
|
|
| 1 |
-
from utils import filenames, images, wallpaper
|
| 2 |
|
| 3 |
prompt = "seamless pattern of parrots. black and white, drawing, white background, seamless, ornament."
|
| 4 |
-
|
|
|
|
|
|
|
| 5 |
generation_dir = "./generations/diamond_crop_img2img"
|
| 6 |
|
| 7 |
sdxl_pipe = pipes.create_stable_diffusion_xl_pipeline()
|
| 8 |
sdxl_img2img_pipe = pipes.create_stable_diffusion_xl_img2img_pipe()
|
| 9 |
|
|
|
|
|
|
|
| 10 |
prompts = [
|
| 11 |
-
"
|
| 12 |
-
"
|
| 13 |
-
"
|
| 14 |
-
"
|
| 15 |
-
"
|
| 16 |
-
"geometric
|
|
|
|
|
|
|
| 17 |
]
|
| 18 |
|
| 19 |
for prompt in prompts:
|
| 20 |
print(f"using prompt: `{prompt}`")
|
|
|
|
| 21 |
|
| 22 |
-
original_image = sdxl_pipe(prompt=prompt, num_inference_steps=inference_steps
|
|
|
|
| 23 |
original_image_filename = filenames.generate_filename(f"{generation_dir}/originals", prompt)
|
| 24 |
original_image.save(original_image_filename)
|
| 25 |
print("generated original image", original_image_filename)
|
|
@@ -31,7 +39,8 @@ for prompt in prompts:
|
|
| 31 |
print("generated inner rotated tile", inner_rotated_tile_filename)
|
| 32 |
|
| 33 |
tileable_image = \
|
| 34 |
-
sdxl_img2img_pipe(prompt, image=inner_rotated_tile.convert("RGB"), num_inference_steps=inference_steps
|
|
|
|
| 35 |
0]
|
| 36 |
tileable_image_filename = filenames.generate_filename(f"{generation_dir}/tiles", prompt, "-tile")
|
| 37 |
tileable_image.save(tileable_image_filename)
|
|
|
|
| 1 |
+
from utils import tiling, pipes, filenames, images, wallpaper
|
| 2 |
|
| 3 |
prompt = "seamless pattern of parrots. black and white, drawing, white background, seamless, ornament."
|
| 4 |
+
desired_output_width = 1024
|
| 5 |
+
inference_steps = 25
|
| 6 |
+
img2img_strength = 0.5
|
| 7 |
generation_dir = "./generations/diamond_crop_img2img"
|
| 8 |
|
| 9 |
sdxl_pipe = pipes.create_stable_diffusion_xl_pipeline()
|
| 10 |
sdxl_img2img_pipe = pipes.create_stable_diffusion_xl_img2img_pipe()
|
| 11 |
|
| 12 |
+
# Sources:
|
| 13 |
+
# - https://aituts.com/midjourney-tile/
|
| 14 |
prompts = [
|
| 15 |
+
"illuminant gold roses repeated pattern flat on a rich bright read paper:: deep colors, stunning palette, intricate details, ornate, detailed illustration, octane render, impressive shadows :: Johanna Rupprecht style, William Morris style",
|
| 16 |
+
"illuminant bronze keys repeated pattern flat on a rich bright read paper:: deep colors, stunning palette, intricate details, ornate, detailed illustration, octane render, impressive shadows :: Johanna Rupprecht style, William Morris style",
|
| 17 |
+
"repeating pattern prayer watercolor, white background, in the style of Rory McEwen, centered on the frame, single leaf",
|
| 18 |
+
"pattern sago palm watercolor, white background, in the style of Rory McEwen, centered on the frame, single leaf",
|
| 19 |
+
"botanical art, watercolor, white background, no background, in the style of Pandora Sellars",
|
| 20 |
+
"Clip Art cityscape, vibrant colors and geometric patterns, a yellow background, designed by Herge, lava glow, Low angle",
|
| 21 |
+
"Craft a 4K visual masterpiece that envisions a surreal quantum garden, where reality blurs with the fantastical. Explore vibrant colors, fractal patterns, and intricate details to create a mesmerizing tapestry of interconnected dimensions. Let the scene evoke a sense of wonder and mystery as viewers explore the boundaries between the tangible and the ethereal",
|
| 22 |
+
"vibrant color grading, long exposure, bokeh, dramatic angle, extreme angle shot, horror, sci-fi",
|
| 23 |
]
|
| 24 |
|
| 25 |
for prompt in prompts:
|
| 26 |
print(f"using prompt: `{prompt}`")
|
| 27 |
+
original_image_size = tiling.compute_input_tile_width_for_desired_output(desired_output_width)
|
| 28 |
|
| 29 |
+
original_image = sdxl_pipe(prompt=prompt, num_inference_steps=inference_steps, width=original_image_size,
|
| 30 |
+
height=original_image_size).images[0]
|
| 31 |
original_image_filename = filenames.generate_filename(f"{generation_dir}/originals", prompt)
|
| 32 |
original_image.save(original_image_filename)
|
| 33 |
print("generated original image", original_image_filename)
|
|
|
|
| 39 |
print("generated inner rotated tile", inner_rotated_tile_filename)
|
| 40 |
|
| 41 |
tileable_image = \
|
| 42 |
+
sdxl_img2img_pipe(prompt, image=inner_rotated_tile.convert("RGB"), num_inference_steps=inference_steps,
|
| 43 |
+
strength=img2img_strength).images[
|
| 44 |
0]
|
| 45 |
tileable_image_filename = filenames.generate_filename(f"{generation_dir}/tiles", prompt, "-tile")
|
| 46 |
tileable_image.save(tileable_image_filename)
|