Downloads · 30 days
56
15% of all-time downloads
Rachit22/flux-lora-manhawa-style
flux-lora-manhawa-style is a text-to-image model from Rachit22. Use it when you need an image from a text prompt. It is set up for diffusers. The card lists the license as other.
Downloads · 30 days
56
15% of all-time downloads
All-time downloads
374
Public
Repo size
812 MB
Likes
2
Public
Click a slice to open those files.
.safetensors52.4 MB · 61%
From the Hugging Face model README
Please use in s456-style; to trigger the image generation in manhawa style.
Check out our blog post on Medium
import torch
from diffusers import DiffusionPipeline
model_id = 'black-forest-labs/FLUX.1-dev'
adapter_id = 'Rachit22/simpletuner-flux-manhawa'
pipeline = DiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.bfloat16) # loading directly in bf16
pipeline.load_lora_weights(adapter_id)
prompt = "in s456-style; a powerful male hunter with grey armor and glowing bluee eyes, shadow summons rising behind him, in a dark dungeon filled with broken statues, high detail"
## Optional: quantise the model to save on vram.
## Note: The model was quantised during training, and so it is recommended to do the same during inference time.
from optimum.quanto import quantize, freeze, qint8
quantize(pipeline.transformer, weights=qint8)
freeze(pipeline.transformer)
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
model_output = pipeline(
prompt=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=1024,
height=1024,
guidance_scale=3.0,
).images[0]
model_output.save("output.png", format="PNG")