CoolFace
Modelpublic

GazTrab/gravlens-grayscale

sourceHugging Faceapache-2.0updated 2y agoView on Hugging Face
0likes3downloads
Model Card

gravlens-grayscale

This is a full rank finetune derived from 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.

You can find some example images in the following gallery:

<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=['trainingschedulertimestepspacing=trailing', 'inferenceschedulertimestepspacing=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")