Spaces:
Runtime error
Runtime error
Commit
·
a10c3fd
1
Parent(s):
a50e6df
Update app.py
Browse files
app.py
CHANGED
|
@@ -14,6 +14,7 @@ MODEL_REPO = 'OFA-Sys/small-stable-diffusion-v0'
|
|
| 14 |
LoRa_DIR = 'weights'
|
| 15 |
DATASET_REPO = 'VESSL/Bored_Ape_NFT_text'
|
| 16 |
SAMPLE_IMAGE = 'weights/Sample.png'
|
|
|
|
| 17 |
def load_pipeline_w_lora() :
|
| 18 |
|
| 19 |
# Load pretrained unet from huggingface
|
|
@@ -64,14 +65,17 @@ def main():
|
|
| 64 |
sample = Image.open(SAMPLE_IMAGE)
|
| 65 |
st.image(sample, caption="Example image with prompt <An ape with solid gold fur and beanie>")
|
| 66 |
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
|
|
|
| 73 |
|
| 74 |
-
|
|
|
|
|
|
|
| 75 |
st.write(f"Generating {num_images} BAYC image with prompt <{prompt}>...")
|
| 76 |
|
| 77 |
generator = torch.Generator(device=device).manual_seed(seed)
|
|
|
|
| 14 |
LoRa_DIR = 'weights'
|
| 15 |
DATASET_REPO = 'VESSL/Bored_Ape_NFT_text'
|
| 16 |
SAMPLE_IMAGE = 'weights/Sample.png'
|
| 17 |
+
|
| 18 |
def load_pipeline_w_lora() :
|
| 19 |
|
| 20 |
# Load pretrained unet from huggingface
|
|
|
|
| 65 |
sample = Image.open(SAMPLE_IMAGE)
|
| 66 |
st.image(sample, caption="Example image with prompt <An ape with solid gold fur and beanie>")
|
| 67 |
|
| 68 |
+
with st.form(key="information", clear_on_submit=True):
|
| 69 |
+
prompt = st.text_input(
|
| 70 |
+
label="Write prompt to generate your unique BAYC image! (e.g. An ape with golden fur)")
|
| 71 |
+
|
| 72 |
+
num_images = st.number_input(label="Number of images to generate"))
|
| 73 |
+
|
| 74 |
+
seed = st.number_input(label="Seed for images")
|
| 75 |
|
| 76 |
+
submitted = st.form_submit_button(label="Submit")
|
| 77 |
+
|
| 78 |
+
if submitted :
|
| 79 |
st.write(f"Generating {num_images} BAYC image with prompt <{prompt}>...")
|
| 80 |
|
| 81 |
generator = torch.Generator(device=device).manual_seed(seed)
|