KranokThaiV1 / README.md
CHAITron's picture
Update README.md
19918d6 verified
|
raw
history blame
2.87 kB
metadata
license: creativeml-openrail-m
tags:
  - stable-diffusion
  - text-to-image

KranokThaiV1 🇹🇭

model by CHAITron

This is the Stable Diffusion model fine-tuned Thai art concept taught to Stable Diffusion. It can be used by modifying the instance_prompt: <knt-style> style

Example Results

example1 Prompt used: "a colourful masterpiece thai cat in <knt-style> style, high-quality, professional art, realistic, thai style"

example1 Prompt used: "a colourful masterpiece thai dog in <knt-style> style, high-quality, professional art, realistic, thai style"

🧨 Diffusers

This model can be used just like any other Stable Diffusion model. For more information, please have a look at the Stable Diffusion.

You can also export the model to ONNX, MPS and/or FLAX/JAX.

pip install torch diffusers accelerate pillow
from diffusers import StableDiffusionPipeline
import torch
from PIL import Image

def image_grid(imgs, rows, cols):
    assert len(imgs) == rows*cols

    w, h = imgs[0].size
    grid = Image.new('RGB', size=(cols*w, rows*h))
    grid_w, grid_h = grid.size

    for i, img in enumerate(imgs):
        grid.paste(img, box=(i%cols*w, i//cols*h))
    return grid

model_id = "CHAITron/KranokThaiV1"
pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16)
pipe = pipe.to("cuda")

prompt = "a colourful masterpiece thai dog in <knt-style> style, high-quality, professional art, realistic, thai style"

num_samples = 4
num_rows = 1

all_images = []
for _ in range(num_rows):
    images = pipe(prompt, num_images_per_prompt=num_samples, num_inference_steps=25, guidance_scale=9).images
    all_images.extend(images)

grid = image_grid(all_images, num_rows, num_samples)
grid

License

This model is open access and available to all, with a CreativeML OpenRAIL-M license further specifying rights and usage. The CreativeML OpenRAIL License specifies:

  1. You can't use the model to deliberately produce nor share illegal or harmful outputs or content
  2. The authors claims no rights on the outputs you generate, you are free to use them and are accountable for their use which must not go against the provisions set in the license
  3. You may re-distribute the weights and use the model commercially and/or as a service. If you do, please be aware you have to include the same use restrictions as the ones in the license and share a copy of the CreativeML OpenRAIL-M to all your users (please read the license entirely and carefully) Please read the full license here