# Dataset Card for "xl-base-0.9-parti-prompts-two"

The dataset was created using the following code:

```python
import torch
from datasets import Dataset, Features
from datasets import Image as ImageFeature
from datasets import Value, load_dataset

from diffusers import DDIMScheduler, DiffusionPipeline


def main():
    print("Loading dataset...")
    parti_prompts = load_dataset("nateraw/parti-prompts", split="train")

    print("Loading pipeline...")
    ckpt_id = "diffusers/stable-diffusion-xl-base-0.9"
    pipe = DiffusionPipeline.from_pretrained(
        ckpt_id, torch_dtype=torch.float16, use_auth_token=True
    ).to("cuda")
    pipe.scheduler = DDIMScheduler.from_config(pipe.scheduler.config)
    pipe.set_progress_bar_config(disable=True)
    generator = torch.Generator("cuda").manual_seed(0)

    print("Running inference...")
    main_dict = {}
    for i in range(len(parti_prompts)):
        prompt = parti_prompts[i]["Prompt"]
        images = pipe(
            prompt,
            generator=generator,
            num_inference_steps=100,
            guidance_scale=7.5,
            num_images_per_prompt=4,
        ).images

        image_paths = []
        for j in range(len(images)):
            path = f"sd_xl_{i}_{j}.png"
            images[j].save(path)
            image_paths.append(path)

        main_dict.update({prompt: image_paths})

    def generation_fn():
        for prompt in main_dict:
            all_image_paths = main_dict[prompt]
            yield {
                "prompt": prompt,
                "image_one": {"path": all_image_paths[0]},
                "image_two": {"path": all_image_paths[1]},
                "image_three": {"path": all_image_paths[2]},
                "image_four": {"path": all_image_paths[3]},
            }

    print("Preparing HF dataset...")
    ds = Dataset.from_generator(
        generation_fn,
        features=Features(
            prompt=Value("string"),
            image_one=ImageFeature(),
            image_two=ImageFeature(),
            image_three=ImageFeature(),
            image_four=ImageFeature(),
        ),
    )
    ds_id = "diffusers/xl-base-0.9-parti-prompts-two"
    ds.push_to_hub(ds_id, private=True)


if __name__ == "__main__":
    main()
```

Explore the dataset here: https://colab.research.google.com/drive/1oSrYN3NWpDKGBmm7PaohLPNJtVemf_Db?usp=sharing.
region:us
{"dataset_info": {"features": [{"name": "prompt", "dtype": "string"}, {"name": "image_one", "dtype": "image"}, {"name": "image_two", "dtype": "image"}, {"name": "image_three", "dtype": "image"}, {"name": "image_four", "dtype": "image"}], "splits": [{"name": "train", "num_bytes": 9599950122.104, "num_examples": 1632}], "download_size": 9638676311, "dataset_size": 9599950122.104}}
TAGS
#region-us 

# Dataset Card for "xl-base-0.9-parti-prompts-two"

The dataset was created using the following code:



Explore the dataset here: URL
# Dataset Card for "xl-base-0.9-parti-prompts-two"

The dataset was created using the following code:



Explore the dataset here: URL
TAGS
#region-us 
 # Dataset Card for "xl-base-0.9-parti-prompts-two"

The dataset was created using the following code:



Explore the dataset here: URL
passage: TAGS
#region-us 
# Dataset Card for "xl-base-0.9-parti-prompts-two"

The dataset was created using the following code:



Explore the dataset here: URL