Don B
commited on
Commit
·
809097b
1
Parent(s):
c2832af
add model to output
Browse files
app.py
CHANGED
@@ -10,7 +10,7 @@ def fetch_images(postID):
|
|
10 |
response.raise_for_status() # This will raise an exception for HTTP errors
|
11 |
data = response.json()
|
12 |
items = data["items"]
|
13 |
-
table_data = [[item["id"], item["meta"]["prompt"], item["meta"].get("negativePrompt", "N/A"), item["meta"]["sampler"], item["meta"]["steps"], item["meta"]["cfgScale"], item["width"], item["height"], item["url"]] for item in items]
|
14 |
return table_data
|
15 |
except requests.RequestException as e:
|
16 |
st.error(f"Failed to fetch images: {e}")
|
@@ -26,6 +26,7 @@ def display_images(df):
|
|
26 |
with col2:
|
27 |
st.markdown(f"**Prompt:** {row['prompt']}")
|
28 |
st.markdown(f"**Negative Prompt:** {row['negativePrompt']}")
|
|
|
29 |
st.markdown(f"**Sampler:** {row['sampler']} | **Steps:** {row['steps']}")
|
30 |
st.markdown(f"**Config Scale:** {row['cfgScale']}")
|
31 |
st.markdown(f"**Image Size:** {row['height']} H x {row['width']} W")
|
@@ -51,7 +52,7 @@ def main():
|
|
51 |
# Convert postID to integer if necessary
|
52 |
try:
|
53 |
postID_int = int(postID_input)
|
54 |
-
df = pd.DataFrame(fetch_images(postID_int), columns=["id", "prompt", "negativePrompt", "sampler", "steps", "cfgScale", "width", "height", "url"])
|
55 |
if not df.empty:
|
56 |
display_images(df)
|
57 |
else:
|
|
|
10 |
response.raise_for_status() # This will raise an exception for HTTP errors
|
11 |
data = response.json()
|
12 |
items = data["items"]
|
13 |
+
table_data = [[item["id"], item["meta"]["prompt"], item["meta"].get("negativePrompt", "N/A"), item["meta"]["Model"],item["meta"]["sampler"], item["meta"]["steps"], item["meta"]["cfgScale"], item["width"], item["height"], item["url"]] for item in items]
|
14 |
return table_data
|
15 |
except requests.RequestException as e:
|
16 |
st.error(f"Failed to fetch images: {e}")
|
|
|
26 |
with col2:
|
27 |
st.markdown(f"**Prompt:** {row['prompt']}")
|
28 |
st.markdown(f"**Negative Prompt:** {row['negativePrompt']}")
|
29 |
+
st.markdown(f"**Model:** {row['Model']}")
|
30 |
st.markdown(f"**Sampler:** {row['sampler']} | **Steps:** {row['steps']}")
|
31 |
st.markdown(f"**Config Scale:** {row['cfgScale']}")
|
32 |
st.markdown(f"**Image Size:** {row['height']} H x {row['width']} W")
|
|
|
52 |
# Convert postID to integer if necessary
|
53 |
try:
|
54 |
postID_int = int(postID_input)
|
55 |
+
df = pd.DataFrame(fetch_images(postID_int), columns=["id", "prompt", "negativePrompt", "Model", "sampler", "steps", "cfgScale", "width", "height", "url"])
|
56 |
if not df.empty:
|
57 |
display_images(df)
|
58 |
else:
|