In my application I'm attempting to create a more detailed prompt for ImageGenerationModel from a simple one that also adheres to the safety settings.
One set I have been using are these but I've tried a variety
safety_config = [
SafetySetting(
category=HarmCategory.HARM_CATEGORY_DANGEROUS_CONTENT,
threshold=HarmBlockThreshold.BLOCK_ONLY_HIGH,
),
SafetySetting(
category=HarmCategory.HARM_CATEGORY_HARASSMENT,
threshold=HarmBlockThreshold.BLOCK_ONLY_HIGH,
),
SafetySetting(
category=HarmCategory.HARM_CATEGORY_HATE_SPEECH,
threshold=HarmBlockThreshold.BLOCK_ONLY_HIGH,
),
SafetySetting(
category=HarmCategory.HARM_CATEGORY_SEXUALLY_EXPLICIT,
threshold=HarmBlockThreshold.BLOCK_LOW_AND_ABOVE,
),
]
So for example I might try to generate content using this prompt:
As an LLM, your job is to generate detailed prompts, for image generation models based on user input.
Be descriptive and specific, but also make sure your prompts are clear, concise and safe and do not include any harm categories.
The user input could be quite simple such as "A yeti in an icy cave" and the response from the model could be:
## Image Prompt: Majestic Yeti in Icy Lair
Setting: A grand, naturally formed ice cave, sunlight filtering through a distant opening, illuminating glittering ice cr__tals.
Subject: A majestic Yeti, standing 10 feet tall, covered in thick white fur with a hint of blue. Its fur should be slightly matted with ice and snow. The Yeti should have intelligent, contemplative eyes that evoke a sense of wisdom and solitude. It holds a staff made of ice, glowing faintly with an inner light.
Pose: The Yeti should be standing tall, gazing out of the cave towards the light, a hint of sadness and longing in its expression.
Mood: The overall mood should be one of serene isolation, awe-inspiring nature, and the quiet dignity of the Yeti.
Color Palette: Predominantly cool blues, whites, and greys, with a hint of warm sunlight filtering through the cave opening.
Style: Hyperrealistic with a touch of fantasy.
If I try to use something like this with a variety of safety settings it invariably fails. If I try to use the model to describe an image generated with the prompt
"What’s in this image? Describe the image only in safe terms without harmful content."
and as many safety settings as seems appropriate it can occasionally fail. Doing any of these actions without safety settings invariably fails.
It feels like Google is actually blocking itself from a variety of steps I would like to take.
Generate a safe detailed prompt! That prompt is not safe.
Generate a safe image! That image is not safe.
افضل اختيار لي صوره مناسبه منك
اشكرك
This could be due to a safety filter false positive. Have you tried setting the safety filter to block_none?
User | Count |
---|---|
2 | |
1 | |
1 | |
1 | |
1 |