---
language:
- en
license: apache-2.0
tags:
- text-generation
- prompt-engineering
- image-generation
- prompt-expansion
- prompt-compression
- prompt-enhancer
- qwen3
base_model:
- Qwen/Qwen3-0.6B
pipeline_tag: text-generation
---

# PromptBridge-0.6b-Alpha

A specialized Qwen3-0.6B model fine-tuned for bidirectional prompt transformation for text-to-image generation.



## Example (Round-Trip)

(Expand → Compress → Expand)

Original Short Prompt: 

> woman, flowing red dress, standing, sunset beach

Step 1: Expand: 

> A woman stands on a sandy beach at sunset, facing forward with a composed, neutral expression. Her fair skin shows a subtle, natural sheen from the warm light. She has a slender, athletic build and long, straight dark‑brown hair that falls to the middle of her back, the strands catching faint highlights that suggest a soft, slightly wavy texture. Her face is symmetrical, with high cheekbones, a straight nose, full lips, and dark brown eyes that gaze directly ahead; the eyes are framed by well‑defined, slightly arched eyebrows. A small, silver hoop earring rests in her left ear, and a thin, matte‑black chain necklace rests against her collarbone. She wears a sleeveless red dress made of a lightweight, slightly textured fabric that drapes fluidly over her torso. The dress features a high, stand‑up collar, a fitted waist that defines her silhouette, and a plunging neckline that reveals a hint of the collarbone. The fabric catches the sunset light with a faint satin luster, and the hem is finished with a subtle, rolled edge that adds a gentle ripple. A narrow, woven red belt with a small, polished stone accent the waist. Her left arm is bent at the elbow, the hand resting lightly on her hip, fingers relaxed. The right arm hangs straight down, the hand relaxed with the palm facing inward. She wears simple, low‑profile sandals made of dark, worn leather that blend into the sand, their soles slightly scuffed. A thin, silver bracelet encircles her left wrist, adding a discreet accent. The background stretches into a vast, flat expanse of light‑brown sand, its surface marked by fine ripples and gentle waves that catch the soft glow of the setting sun. In the distance, low dunes rise faintly against a sky that shifts from deep orange at the horizon to pale teal near the horizon, with a few scattered, wispy clouds catching the last rays of light. The overall lighting is warm and diffused, casting gentle shadows that emphasize the contours of her body and the folds of the dress, while the golden hue of the sunset enhances the reds and greens of her attire, creating a harmonious, tranquil atmosphere.

Step 2: Compress to Keywords: 

> fair-skinned athletic woman, dark brown wavy hair, red sleeveless dress, standing on sand beach, sunset golden glow, left arm bent hand on hip, right arm relaxed palm inward, dark leather sandals, silver hoop earring necklace, thin matte black chain necklace, silver bracelet on wrist, large orange teal sky, gentle ripples and dunes, warm diffused lighting

Step 3: Expand Again: 

> A woman stands on a sandy beach at sunset, her body angled slightly to the right while she faces the camera. Her dark brown hair is long, wavy, and falls past her shoulders, with a few strands framing her face and catching the warm light. She has fair skin, high cheekbones, full lips, and dark brown eyes that look directly at the viewer. A small, polished silver hoop earring glints in her left ear. She wears a red, form‑fitting sleeveless dress made of a smooth, slightly reflective fabric. The dress features a deep V‑neckline, a subtle embossed geometric pattern on the shoulders, and a high slit on the left side that reveals a glimpse of her left thigh. The material has a faint sheen that catches the light, emphasizing the curve of her hips. On her left wrist she has a thin silver bracelet, and a delicate chain necklace with a tiny pendant rests against the dress. Her left arm is bent, the hand resting lightly on her hip; the right arm hangs relaxed at her side, the palm turned inward. She wears simple dark leather sandals with thin straps that match the dress, and small, matte black stud earrings. The beach beneath her is composed of fine, light‑tan sand with subtle ripples that reflect the sunset glow. Behind her, the sky is a gradient of deep orange fading into teal, the sun low and bright, casting a warm, diffused light that creates a soft rim of illumination around her shoulders and a gentle shadow on the sand to her left. Small dunes rise faintly in the distance, adding texture to the horizon. The overall scene is bathed in warm, golden tones that highlight the colors of the dress and the earthy palette of the beach.

## Model Description

PromptBridge-0.6b-Alpha can perform two kinds of prompt transformations:

- **Prompt Expansion**: Converts brief keywords or a single sentences into detailed prompts suitable for image generation models.
- **Prompt Compression**: Distills lengthy image generation prompts into concise keywords or single sentences.

Which also allows it to generate variations by chaining these operations (expand → compress → re-expand).

**PromptBridge-0.6b-Alpha is trained exclusively on prompts that featuers a single, adult human(oid) subject.**

The model was trained on approximately 300k pairs of prompts (300M tokens).

The content rating distribution of the training data is as follows (rated by gpt-oss-120b):

- **PG**:  153680
- **PG-13**: 128890
- **R**: 8910
- **X**: 0 (80 X-rated prompts were removed from the training data.)

Therefore, the model may generate sensitive content - you are solely responsible for the output you generate.

The training data is 100% synthetic and was created by the following pipeline:

1. Randomly roll keywords
2. Generate image based on keywords
3. Caption Image using Qwen3-VL-32b-Instruct-FP8
4. Refine Caption with gpt-oss-120b
5. Create training pairs by reversing caption into keywords and one sentence descriptions

## Usage

The model requires one of three specific system prompts:

- `"Expand the prompt."`
- `"Compress the prompt into one sentence."`
- `"Compress the prompt into keyword format."`

```python
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch

model_name = "retowyss/PromptBridge-0.6b-Alpha"
model = AutoModelForCausalLM.from_pretrained(
    model_name,
    trust_remote_code=True,
    torch_dtype=torch.bfloat16,
    device_map="auto"
)
tokenizer = AutoTokenizer.from_pretrained(model_name, trust_remote_code=True)

# mode = "Compress the prompt into one sentence."
# mode = "Compress the prompt into keyword format."
mode = "Expand the prompt."


# Expansion example
messages = [
    {"role": "system", "content": mode},
    {"role": "user", "content": "woman, flowing red dress, standing, sunset beach"}
]

text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(text, return_tensors="pt").to(model.device)

outputs = model.generate(
    **inputs,
    max_new_tokens=512,
    temperature=0.2,
    top_p=0.9,
    do_sample=True
)
response = tokenizer.decode(outputs[0][inputs['input_ids'].shape[1]:], skip_special_tokens=True)
print(response)
```

Works with vllm.

```
vllm serve retowyss/PromptBridge-0.6b-Alpha
```

## Training Results

- **Initial Loss**: 2.95 (PPL: 19.08)
- **Final Loss**: 1.24 (PPL: 3.43)
- **Training Duration**: ~8.0 RTX 5090 hours

## Limitations

1. **Token Length**: May generate prompts exceeding typical token limits used by image models.
2. **Specialization**: Cannot perform general instruction-following tasks, reasoning, or chat functions.
3. **Domain**: Optimized for human subject descriptions; performance on other subjects is neither trained nor tested.
4. **Content**: Trained on PG to R-rated content; may not handle extreme content.

## Ethical Considerations

### Content Policy
- Training data filtered to remove explicit (X-rated) content
- Removed prompts containing minors (<20 years old) or brand references
- Retained R-rated content as it represents realistic artistic descriptions

```bibtex
@misc{promptbridge_0.6b_alpha},
  author = {Wyss Reto},
  title = {PromptBridge-0.6b-Alpha: Bidirectional Prompt Transformation for Image Generation},
  year = {2026},
  publisher = {HuggingFace},
  howpublished = {\url{https://huggingface.co/retowyss/PromptBridge-0.6b-Alpha}}
}
```

## Model Card Contact

For questions or feedback, please open an issue on the model repository.