Spaces:
Running
on
Zero
Running
on
Zero
Update models.py
Browse files
models.py
CHANGED
@@ -148,13 +148,19 @@ class BagelAPIAnalyzer(BaseImageAnalyzer):
|
|
148 |
try:
|
149 |
# Default prompt for detailed image analysis
|
150 |
if prompt is None:
|
151 |
-
prompt = """
|
152 |
|
153 |
-
1. DESCRIPTION:
|
154 |
|
155 |
-
2. CAMERA_SETUP: Based on the photographic characteristics you observe, recommend the specific camera system
|
|
|
|
|
|
|
|
|
|
|
|
|
156 |
|
157 |
-
|
158 |
|
159 |
# Save image to temporary file
|
160 |
temp_path = self._save_temp_image(image)
|
@@ -214,13 +220,22 @@ Format your response clearly with these two sections."""
|
|
214 |
|
215 |
def analyze_for_flux_prompt(self, image: Image.Image) -> Tuple[str, Dict[str, Any]]:
|
216 |
"""Analyze image specifically for FLUX prompt generation"""
|
217 |
-
flux_prompt = """
|
218 |
|
219 |
-
1. DESCRIPTION:
|
|
|
|
|
|
|
|
|
|
|
220 |
|
221 |
-
2. CAMERA_SETUP: Recommend
|
222 |
-
|
223 |
-
|
|
|
|
|
|
|
|
|
224 |
|
225 |
return self.analyze_image(image, flux_prompt)
|
226 |
|
|
|
148 |
try:
|
149 |
# Default prompt for detailed image analysis
|
150 |
if prompt is None:
|
151 |
+
prompt = """You are analyzing a photograph for FLUX image generation. Provide a detailed analysis in two sections:
|
152 |
|
153 |
+
1. DESCRIPTION: Start directly with the subject (e.g., "A color photograph showing..." or "A black and white photograph depicting..."). First, determine if this is a photograph, illustration, or artwork. Then describe the visual elements, composition, lighting, colors (be specific about the color palette - warm tones, cool tones, monochrome, etc.), artistic style, mood, and atmosphere. Write as a flowing paragraph without numbered lists.
|
154 |
|
155 |
+
2. CAMERA_SETUP: Based on the photographic characteristics and scene type you observe, recommend the specific camera system and lens that would realistically capture this type of scene:
|
156 |
+
- For street/documentary photography: suggest cameras like Canon EOS R6, Sony A7 IV, Leica Q2 with 35mm or 24-70mm lenses
|
157 |
+
- For portraits: suggest cameras like Canon EOS R5, Sony A7R V with 85mm or 135mm lenses
|
158 |
+
- For landscapes: suggest cameras like Phase One XT, Fujifilm GFX with wide-angle lenses
|
159 |
+
- For sports/action: suggest cameras like Canon EOS-1D X, Sony A9 III with telephoto lenses
|
160 |
+
- For macro: suggest specialized macro lenses
|
161 |
+
Be specific about focal length, aperture, and shooting style based on what you actually see in the image.
|
162 |
|
163 |
+
Analyze carefully and be accurate about colors and image type."""
|
164 |
|
165 |
# Save image to temporary file
|
166 |
temp_path = self._save_temp_image(image)
|
|
|
220 |
|
221 |
def analyze_for_flux_prompt(self, image: Image.Image) -> Tuple[str, Dict[str, Any]]:
|
222 |
"""Analyze image specifically for FLUX prompt generation"""
|
223 |
+
flux_prompt = """You are analyzing a photograph for professional FLUX generation. Provide two sections:
|
224 |
|
225 |
+
1. DESCRIPTION: Determine first if this is a real photograph, digital artwork, or illustration. Then create a detailed, flowing description starting directly with the subject. Be precise about:
|
226 |
+
- Image type (photograph, illustration, artwork)
|
227 |
+
- Color palette (specify if color or black/white, warm/cool tones, specific colors)
|
228 |
+
- Photographic style (street, portrait, landscape, documentary, artistic, etc.)
|
229 |
+
- Composition, lighting, mood, and atmosphere
|
230 |
+
Write as a single coherent paragraph.
|
231 |
|
232 |
+
2. CAMERA_SETUP: Recommend specific professional equipment that would realistically capture this exact scene:
|
233 |
+
- Street/urban scenes: Canon EOS R6, Sony A7 IV, Leica Q2 with 24-70mm f/2.8 or 35mm f/1.4
|
234 |
+
- Portraits: Canon EOS R5, Sony A7R V, Hasselblad X2D with 85mm f/1.4 or 135mm f/2
|
235 |
+
- Landscapes: Phase One XT, Fujifilm GFX 100S with 16-35mm f/2.8 or 40mm f/4
|
236 |
+
- Documentary: Canon EOS-1D X, Sony A9 III with 24-105mm f/4 or 70-200mm f/2.8
|
237 |
+
- Action/Sports: Canon EOS R3, Sony A1 with 300mm f/2.8 or 400mm f/2.8
|
238 |
+
Match the equipment to what you actually observe in the scene type and shooting conditions."""
|
239 |
|
240 |
return self.analyze_image(image, flux_prompt)
|
241 |
|