Spaces:
Sleeping
Sleeping
| story_to_prompt = ''' | |
| You are an expert in crafting vivid, cinematic prompts for image generation models like Midjourney, DALL·E, or Stable Diffusion. | |
| Given a paragraph describing a visual scene, rewrite it as a single, detailed sentence that captures the atmosphere, key visual elements, emotions, and composition — as if directing a high-quality cinematic image. | |
| Example input: | |
| "A bustling street scene sets the tone for a culinary journey, as the camera pans across the exterior of a cozy vegetarian restaurant, with the sign 'Vegetarian Delights' prominently displayed. The camera takes us inside, where the warm and inviting atmosphere is filled with the aroma of spices and the soft glow of lighting, highlighting the menu and the chefs expertly preparing a variety of vegetarian dishes. A satisfied customer takes a bite of their meal, with a look of delight on their face, as the camera zooms in on the flavors and textures of the dish, evoking a sense of joy and contentment." | |
| Desired output: | |
| "A cinematic street scene reveals the charming exterior of 'Vegetarian Delights,' then glides into a warmly lit, spice-scented interior where skilled chefs craft vibrant vegetarian dishes and a delighted diner savors each flavorful bite in glowing ambiance." | |
| ''' | |
| image_captioning_prompt = ''' | |
| Analyze the image deeply and give the story of the image what it wants to say? | |
| ''' | |
| def initial_story_prompt(retrieval , state): | |
| return ( | |
| f''' | |
| I want to create a detailed storyline for a video in any domain. You have to provide me that storyline what to include in the video. | |
| Now, i am giving you the topic of the video. But the need is to generate the story focusing on the format that i'll provide to you. | |
| You can use this format for the reference purpose, not for the exact similar generation. The format is:\n{retrieval}. | |
| \n\n Now let's start creating the storyline for my topic. The topic of the video is: \n\n{state.topic}''' | |
| ) | |
| def refined_story_prompt(retrieval , state): | |
| return( | |
| f''' | |
| I want to create a detailed storyline for a video in the given topic. You have to provide me that storyline what to include in the video. | |
| Now, i am giving you the topic of the video. But the need is to generate the story focusing on the format that i'll provide to you. | |
| You can use this format for the reference purpose, not for the exact similar generation. The format is:\n{retrieval}. | |
| \n\n Now let's start creating the storyline for my topic. The topic of the video is: \n\n{state.topic}\n\n | |
| **Final Reminder** You have to strongly focus on these topics while creating the storyline: {state.preferred_topics[-1]} and {state.image_captions[-1]}''' | |
| ) | |
| def brainstroming_prompt(state): | |
| return( | |
| f''' | |
| I want to brainstorm ways to diversify or improve a storyline in exactly 4 sentences. | |
| The goal is to generate creative and actionable ideas that are not on the storyline on how the storyline can be expanded or modified for better engagement. | |
| For example: If the storyline is about creating a promotional video for a restaurant, the new suggestions might include: | |
| - I want to showcase the chef preparing a signature dish. | |
| - I want to add a sequence of customers sharing their experiences at the restaurant. | |
| - I want to highlight the farm-to-table sourcing of ingredients with a short segment showing local farms. | |
| - I want to include a time-lapse of the restaurant transforming from day to night, capturing its unique ambiance. | |
| - I want to feature a quick interview with the owner sharing the story behind the restaurant. | |
| Now, I will provide you with the storyline. The storyline is:\n{state.stories[-1]}''' | |
| ) | |
| def final_story_prompt(final_state): | |
| return( | |
| f''' | |
| I want to create a detailed storyline for a video in the given topic. You have to provide me that storyline what to include in the video. | |
| Now, i am giving you the topic of the video. But the need is to generate the story focusing on the format that i'll provide to you. | |
| You can use this format for the reference purpose, not for the exact similar generation. The format is:\n{final_state['retrievals'][-1]}. | |
| \n\n Now let's start creating the storyline for my topic. The topic of the video is: \n\n{final_state['topic']}\n\n | |
| **Final Reminder** You have to strongly focus on these topics while creating the storyline: {[item for sublist in final_state['preferred_topics'] for item in sublist]}''' | |
| ) | |