Spaces:
Runtime error
Runtime error
gaspar-avit
commited on
Commit
•
5c3c7cb
1
Parent(s):
8741317
Update app.py
Browse files
app.py
CHANGED
@@ -181,7 +181,8 @@ def query_generate(text, genres, year):
|
|
181 |
-param text: text to generate image
|
182 |
-return: generated image
|
183 |
"""
|
184 |
-
API_URL = "https://api-inference.huggingface.co/models/runwayml/stable-diffusion-v1-5"
|
|
|
185 |
headers = {"Authorization": f"Bearer {st.secrets['hf_token']}"}
|
186 |
text = 'A movie Poster in portrait mode based on the following synopsis: \"' + text + '\". Style: ' + genres + ', year ' + year + \
|
187 |
'. Ignore ' + ''.join(random.choices(string.ascii_letters, k=10))
|
@@ -287,6 +288,12 @@ if __name__ == "__main__":
|
|
287 |
|
288 |
# Set page footer
|
289 |
footer()
|
|
|
|
|
|
|
|
|
|
|
|
|
290 |
## ---------------------------- ##
|
291 |
|
292 |
|
|
|
181 |
-param text: text to generate image
|
182 |
-return: generated image
|
183 |
"""
|
184 |
+
#API_URL = "https://api-inference.huggingface.co/models/runwayml/stable-diffusion-v1-5"
|
185 |
+
API_URL = "https://api-inference.huggingface.co/models/stabilityai/stable-diffusion-2-1"
|
186 |
headers = {"Authorization": f"Bearer {st.secrets['hf_token']}"}
|
187 |
text = 'A movie Poster in portrait mode based on the following synopsis: \"' + text + '\". Style: ' + genres + ', year ' + year + \
|
188 |
'. Ignore ' + ''.join(random.choices(string.ascii_letters, k=10))
|
|
|
288 |
|
289 |
# Set page footer
|
290 |
footer()
|
291 |
+
|
292 |
+
# Set sidebar with info
|
293 |
+
st.sidebar.markdown("## Generating movie posters using Stable Diffusion")
|
294 |
+
st.sidebar.markdown("This streamlit space aims to generate movie posters based on synopsis.")
|
295 |
+
st.sidebar.markdown("Firstly, the synopsis of the selected movie is extracted from the dataset and then summarized using Facebook's BART model.")
|
296 |
+
st.sidebar.markdown("Once the movie's summary is ready, it is passed to the Stable Diffusion v1.5 model using HF's Inference API, with some prompt tuning.")
|
297 |
## ---------------------------- ##
|
298 |
|
299 |
|