SimpleTuner icon indicating copy to clipboard operation
SimpleTuner copied to clipboard

Error when using mask in combination with aws/S3/R2 storage

Open StableLlama opened this issue 8 months ago • 0 comments

Storing training images and masking images in the aws/S3/R2 cloud or also just storing the images there and the masks locally I get this error:

  File "/root/SimpleTuner/helpers/multiaspect/sampler.py", line 500, in connect_conditioning_samples
    sample_path = sample["image_path"].split(
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: empty separator

The config file is e.g.:

[
    {
        "id": "text-embed-cache",
        "dataset_type": "text_embeds",
        "default": true,
        "type": "local",
        "cache_dir": "/root/SimpleTuner/modal_output/cache/text",
        "write_batch_size": 128
    },
    {
        "id": "image-embed-storage",
        "type": "local",
        "dataset_type": "image_embeds"
    },
    {
        "id": "clothing-512-image",
        "type": "aws",
        "dataset_type": "image",
        "conditioning_data": "clothing-512-mask",
        "aws_bucket_name": "ancientrome-clothing-250501-512-image",
        "aws_endpoint_url": "https://xyz.r2.cloudflarestorage.com",
        "aws_access_key_id": "xyz",
        "aws_secret_access_key": "xyz",
        "aws_region_name": null,
        "image_embeds": "image-embed-storage",
        "crop": false,
        "resolution_type": "pixel_area",
        "metadata_backend": "discovery",
        "caption_strategy": "textfile",
        "cache_dir_vae": "/root/SimpleTuner/modal_output/cache/vae/512n",
        "preserve_data_backend_cache": true,
        "resolution": 512,
        "minimum_image_size": 384,
        "repeats": 2
    },
    {
        "id": "clothing-512-mask",
        "dataset_type": "conditioning",
        "conditioning_type": "mask",
        "type": "local",
        "instance_data_dir": "/root/training/data/clothing_512_250501/mask",
        "crop": false,
        "resolution_type": "pixel_area",
        "metadata_backend": "discovery",
        "caption_strategy": "textfile",
        "preserve_data_backend_cache": true,
        "resolution": 512,
        "minimum_image_size": 384
    },
    {
        "id": "clothing-1024-image",
        "type": "aws",
        "dataset_type": "image",
        "conditioning_data": "clothing-1024-mask",
        "aws_bucket_name": "ancientrome-clothing-250501-1024-image",
        "aws_endpoint_url": "https://xyz.r2.cloudflarestorage.com",
        "aws_access_key_id": "xyz",
        "aws_secret_access_key": "xyz",
        "aws_region_name": null,
        "image_embeds": "image-embed-storage",
        "crop": false,
        "resolution_type": "pixel_area",
        "metadata_backend": "discovery",
        "caption_strategy": "textfile",
        "cache_dir_vae": "/root/SimpleTuner/modal_output/cache/vae/1024",
        "preserve_data_backend_cache": true,
        "resolution": 1024,
        "minimum_image_size": 768,
        "repeats": 1
    },
    {
        "id": "clothing-1024-mask",
        "dataset_type": "conditioning",
        "conditioning_type": "mask",
        "type": "local",
        "instance_data_dir": "/root/training/data/clothing_1024_250501/mask",
        "crop": false,
        "resolution_type": "pixel_area",
        "metadata_backend": "discovery",
        "caption_strategy": "textfile",
        "preserve_data_backend_cache": true,
        "resolution": 1024,
        "minimum_image_size": 768
    },
    {
        "id": "clothing-eval",
        "type": "aws",
        "dataset_type": "eval",
        "aws_bucket_name": "ancientrome-clothing-250501-eval",
        "aws_endpoint_url": "https://xyz.r2.cloudflarestorage.com",
        "aws_access_key_id": "xyz",
        "aws_secret_access_key": "xyz",
        "aws_region_name": null,
        "image_embeds": "image-embed-storage",
        "resolution": 1024,
        "minimum_image_size": 1024,
        "maximum_image_size": 1024,
        "target_downsample_size": 1024,
        "resolution_type": "pixel_area",
        "cache_dir_vae": "/root/SimpleTuner/modal_output/cache/vae/eval",
        "caption_strategy": "textfile"
    }
]

Storing images and masks local it's working.

StableLlama avatar May 02 '25 18:05 StableLlama