Don B
commited on
Commit
·
be8660e
1
Parent(s):
643ee53
add additional parameters
Browse files
app.py
CHANGED
|
@@ -14,7 +14,7 @@ def fetch_images(postID):
|
|
| 14 |
response.raise_for_status() # This will raise an exception for HTTP errors
|
| 15 |
data = response.json()
|
| 16 |
items = data["items"]
|
| 17 |
-
table_data = [[item["id"], item["meta"]["prompt"], item["meta"]["negativePrompt"], item["url"]] for item in items]
|
| 18 |
return table_data
|
| 19 |
except requests.RequestException as e:
|
| 20 |
st.error(f"Failed to fetch images: {e}")
|
|
@@ -29,6 +29,9 @@ def display_images(df):
|
|
| 29 |
with col2:
|
| 30 |
st.markdown(f"**Prompt:** {row['prompt']}")
|
| 31 |
st.markdown(f"**Negative Prompt:** {row['negativePrompt']}")
|
|
|
|
|
|
|
|
|
|
| 32 |
|
| 33 |
def main():
|
| 34 |
st.title('Civitai Model Showcase Prompts')
|
|
@@ -47,7 +50,7 @@ def main():
|
|
| 47 |
# Convert postID to integer if necessary
|
| 48 |
try:
|
| 49 |
postID_int = int(postID)
|
| 50 |
-
df = pd.DataFrame(fetch_images(postID_int), columns=["id", "prompt", "negativePrompt", "url"])
|
| 51 |
if not df.empty:
|
| 52 |
display_images(df)
|
| 53 |
else:
|
|
|
|
| 14 |
response.raise_for_status() # This will raise an exception for HTTP errors
|
| 15 |
data = response.json()
|
| 16 |
items = data["items"]
|
| 17 |
+
table_data = [[item["id"], item["meta"]["prompt"], item["meta"]["negativePrompt"], item["meta"]["sampler"], item["meta"]["steps"], item["meta"]["cfgScale"], item["url"]] for item in items]
|
| 18 |
return table_data
|
| 19 |
except requests.RequestException as e:
|
| 20 |
st.error(f"Failed to fetch images: {e}")
|
|
|
|
| 29 |
with col2:
|
| 30 |
st.markdown(f"**Prompt:** {row['prompt']}")
|
| 31 |
st.markdown(f"**Negative Prompt:** {row['negativePrompt']}")
|
| 32 |
+
st.markdown(f"**Sampler:** {row['sampler']}")
|
| 33 |
+
st.markdown(f"**Steps:** {row['steps']}")
|
| 34 |
+
st.markdown(f"**Config Scale:** {row['cfgScale']}")
|
| 35 |
|
| 36 |
def main():
|
| 37 |
st.title('Civitai Model Showcase Prompts')
|
|
|
|
| 50 |
# Convert postID to integer if necessary
|
| 51 |
try:
|
| 52 |
postID_int = int(postID)
|
| 53 |
+
df = pd.DataFrame(fetch_images(postID_int), columns=["id", "prompt", "negativePrompt", "sampler", "steps", "cfgScale", "url"])
|
| 54 |
if not df.empty:
|
| 55 |
display_images(df)
|
| 56 |
else:
|