I'm working on a pipeline that uses DALL-E 3 for iterative image generation, where each output is fed back as a prompt input for the next step. Think of a multi-stage concept refinement.
I've observed noticeable quality loss after just 2-3 iterations. Details get blurrier, artifacts appear, and composition coherence degrades. It's not simple prompt drift; it feels like a compounding error.
Has anyone done systematic testing on this? I'm looking for quantifiable metrics, not just subjective takes. Potential factors:
- Using `response_format="b64_json"` vs. URL.
- The impact of different `quality` and `style` parameters across edits.
- Whether using a "seed" value mitigates the degradation.
My initial, unscientific test loop looked like this:
```python
import base64
from openai import OpenAI
client = OpenAI()
image_b64 = None
for i in range(5):
prompt = f"Refine this image further: {previous_description}" if i > 0 else "A detailed cyberpunk city street."
if image_b64:
# Using the previous image as a base is hypothetical; API doesn't allow direct image input for DALL-E 3.
# This is a simplification for the concept.
pass
response = client.images.generate(
model="dall-e-3",
prompt=prompt,
size="1024x1024",
quality="standard",
response_format="b64_json",
n=1,
)
image_b64 = response.data[0].b64_json
# Save image, run analysis (e.g., Laplacian variance for blur, artifact detection)
```
The real workflow involves parsing the generated image, extracting a description via GPT-4V, then feeding that back. The degradation seems to happen in that loop.
Is this a known limitation? Are there documented best practices for maintaining fidelity in iterative workflows with this model?