Downloads · 30 days
18
17% of all-time downloads
louijiec/monogatari-generation-model
monogatari-generation-model is a text generation model from louijiec. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as apache-2.0.
This is a fine-tuned version of mistralai/Mistral-7B-Instruct-v0.2 specialized for generating descriptive, high-quality prompts for manga and anime-style image generation.
Downloads · 30 days
18
17% of all-time downloads
All-time downloads
104
Public
Parameters
7.4B
4.5 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors4.5 GB · 100%
How the weights are stored.
U87B · 95%
From the Hugging Face model README
This is a fine-tuned version of mistralai/Mistral-7B-Instruct-v0.2 specialized for generating descriptive, high-quality prompts for manga and anime-style image generation.
The model was fine-tuned on a curated dataset of prompts to learn the structure, keywords, and artistic styles commonly used to create compelling manga art. The name "Monogatari" (物語) is Japanese for "story" or "tale," reflecting the model's purpose in helping users craft visual stories.
This model was trained using 4-bit quantization (QLoRA) with PEFT, making it efficient and accessible.
The primary use case for this model is to act as a creative assistant for artists, hobbyists, and developers working with text-to-image models (like Stable Diffusion, Midjourney, etc.). It can take a basic idea and expand it into a rich, detailed prompt.
You must format your input using the ### Prompt: prefix for the model to work as intended.
Example Use Cases:
succinctly/midjourney-prompts dataset. It will reflect the biases and common tropes present in that data. This may include stylistic preferences, character archetypes, and other patterns from the source prompts.You can run this model easily using the transformers library. Make sure to install the necessary dependencies first. The model is loaded in 4-bit to save memory.
# Install required libraries
pip install -q transformers accelerate bitsandbytes torch```
```python
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM, pipeline
# The Hugging Face Hub model ID
model_id = "louijiec/monogatari-generation-model"
# Load the tokenizer
tokenizer = AutoTokenizer.from_pretrained(model_id)
# Load the model with 4-bit quantization
model = AutoModelForCausalLM.from_pretrained(
model_id,
load_in_4bit=True,
torch_dtype=torch.float16,
device_map="auto"
)
# Create a text generation pipeline
generator = pipeline(
"text-generation",
model=model,
tokenizer=tokenizer
)
# --- Your creative idea goes here! ---
# Remember to use the '### Prompt:' format.
base_prompt = "### Prompt: a close-up portrait of a powerful female samurai with cherry blossoms"
# Generate the detailed prompt
result = generator(
base_prompt,
max_new_tokens=75, # Adjust as needed
num_return_sequences=1,
eos_token_id=tokenizer.eos_token_id,
do_sample=True, # Set to True for more creative, less deterministic outputs
temperature=0.7,
top_p=0.9,
)
print("--- Generated Prompt ---")
print(result['generated_text'])
print("------------------------")
# Example Output:
# --- Generated Prompt ---
# ### Prompt: a close-up portrait of a powerful female samurai with cherry blossoms, intricate armor details, sharp focus, cinematic lighting, dramatic pose, by Kentaro Miura and Makoto Shinkai, detailed face, emotional expression, rule of thirds, 8k, trending on artstation
# ------------------------