adi2606 commited on
Commit
dce5242
β€’
1 Parent(s): 08b3f57

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -4,6 +4,7 @@ import numpy as np
4
  from diffusers import DiffusionPipeline
5
  from transformers import pipeline
6
 
 
7
  text_pipe = pipeline('text-generation', model='daspartho/prompt-extend')
8
 
9
  def extend_prompt(prompt):
@@ -30,6 +31,7 @@ def generate_image(prompt, use_details, steps, seed, use_cuda):
30
  image = pipe(prompt=extended_prompt, generator=generator, num_inference_steps=steps, guidance_scale=0.0).images[0]
31
  return image, extended_prompt
32
 
 
33
  st.markdown("""
34
  <style>
35
  body {background-color: #E8F5E9;}
@@ -41,12 +43,13 @@ st.markdown("""
41
  st.markdown("<div class='header'>✨ Generate Your Custom GitHub Profile Picture! ✨</div>", unsafe_allow_html=True)
42
  st.markdown("<div class='subheader'>Create an anime-style GitHub profile picture that reflects your personality and passion for coding. πŸš€πŸ‘¨β€πŸ’»</div>", unsafe_allow_html=True)
43
 
 
44
  input_text = st.text_area("Describe your GitHub profile picture:",
45
  "Create an anime-style GitHub profile picture for a boy. The character should have a friendly and approachable expression, embodying a sense of curiosity and enthusiasm, reflecting the qualities of a passionate coder. Incorporate elements that suggest technology or coding, such as a pair of stylish glasses, a laptop, or a background with subtle code or tech motifs. Use vibrant and appealing colors to make the profile picture stand out and convey a sense of creativity and innovation.")
46
 
47
  details_checkbox = st.checkbox("Generate Details?", value=True)
48
  steps_slider = st.slider("Number of Iterations", min_value=1, max_value=5, value=2, step=1)
49
- seed_slider = st.slider("Seed", min_value=0, max_value=9007199254740991, value=398231747038484200, step=1)
50
  cuda_checkbox = st.checkbox("Use CUDA?", value=False)
51
 
52
  if st.button("Generate Image"):
 
4
  from diffusers import DiffusionPipeline
5
  from transformers import pipeline
6
 
7
+ # Load text generation pipeline
8
  text_pipe = pipeline('text-generation', model='daspartho/prompt-extend')
9
 
10
  def extend_prompt(prompt):
 
31
  image = pipe(prompt=extended_prompt, generator=generator, num_inference_steps=steps, guidance_scale=0.0).images[0]
32
  return image, extended_prompt
33
 
34
+ # Custom CSS styling
35
  st.markdown("""
36
  <style>
37
  body {background-color: #E8F5E9;}
 
43
  st.markdown("<div class='header'>✨ Generate Your Custom GitHub Profile Picture! ✨</div>", unsafe_allow_html=True)
44
  st.markdown("<div class='subheader'>Create an anime-style GitHub profile picture that reflects your personality and passion for coding. πŸš€πŸ‘¨β€πŸ’»</div>", unsafe_allow_html=True)
45
 
46
+ # Input widgets
47
  input_text = st.text_area("Describe your GitHub profile picture:",
48
  "Create an anime-style GitHub profile picture for a boy. The character should have a friendly and approachable expression, embodying a sense of curiosity and enthusiasm, reflecting the qualities of a passionate coder. Incorporate elements that suggest technology or coding, such as a pair of stylish glasses, a laptop, or a background with subtle code or tech motifs. Use vibrant and appealing colors to make the profile picture stand out and convey a sense of creativity and innovation.")
49
 
50
  details_checkbox = st.checkbox("Generate Details?", value=True)
51
  steps_slider = st.slider("Number of Iterations", min_value=1, max_value=5, value=2, step=1)
52
+ seed_slider = st.slider("Seed", min_value=0, max_value=9007199254740991, value=3982317, step=1)
53
  cuda_checkbox = st.checkbox("Use CUDA?", value=False)
54
 
55
  if st.button("Generate Image"):