--- license: apache-2.0 base_model: "kwai-kolors/kolors-diffusers" tags: - kolors - kolors-diffusers - text-to-image - diffusers - simpletuner - safe-for-work - full inference: true widget: - text: 'unconditional (blank prompt)' parameters: negative_prompt: 'blurry, cropped, ugly' output: url: ./assets/image_0_0.png - text: 'gravitational lensing effects on galaxy' parameters: negative_prompt: 'blurry, cropped, ugly' output: url: ./assets/image_1_0.png --- # gravlens-grayscale This is a full rank finetune derived from [kwai-kolors/kolors-diffusers](https://huggingface.co/kwai-kolors/kolors-diffusers). The main validation prompt used during training was: ``` gravitational lensing effects on galaxy ``` ## Validation settings - CFG: `5.0` - CFG Rescale: `0.0` - Steps: `20` - Sampler: `None` - Seed: `42` - Resolution: `512x512` Note: The validation settings are not necessarily the same as the [training settings](#training-settings). You can find some example images in the following gallery: The text encoder **was not** trained. You may reuse the base model text encoder for inference. ## Training settings - Training epochs: 0 - Training steps: 6750 - Learning rate: 1e-06 - Learning rate schedule: constant - Warmup steps: 675 - Max grad norm: 2.0 - Effective batch size: 8 - Micro-batch size: 8 - Gradient accumulation steps: 1 - Number of GPUs: 1 - Gradient checkpointing: True - Prediction type: epsilon (extra parameters=['training_scheduler_timestep_spacing=trailing', 'inference_scheduler_timestep_spacing=trailing']) - Optimizer: optimi-lion - Trainable parameter precision: Pure BF16 - Caption dropout probability: 10.0% ## Datasets ### grayscale-lensing-256 - Repeats: 15 - Total number of images: 3689 - Total number of aspect buckets: 1 - Resolution: 0.065536 megapixels - Cropped: False - Crop style: None - Crop aspect: None - Used for regularisation data: No ### grayscale-lensing-512 - Repeats: 15 - Total number of images: 1801 - Total number of aspect buckets: 1 - Resolution: 0.262144 megapixels - Cropped: False - Crop style: None - Crop aspect: None - Used for regularisation data: No ## Inference ```python import torch from diffusers import DiffusionPipeline model_id = 'GazTrab/gravlens-grayscale' pipeline = DiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float32) # loading directly in bf16 prompt = "gravitational lensing effects on galaxy" negative_prompt = 'blurry, cropped, ugly' pipeline.to('cuda' if torch.cuda.is_available() else 'mps' if torch.backends.mps.is_available() else 'cpu') # the pipeline is already in its target precision level image = pipeline( prompt=prompt, negative_prompt=negative_prompt, num_inference_steps=20, generator=torch.Generator(device='cuda' if torch.cuda.is_available() else 'mps' if torch.backends.mps.is_available() else 'cpu').manual_seed(42), width=512, height=512, guidance_scale=5.0, guidance_rescale=0.0, ).images[0] image.save("output.png", format="PNG") ```