logo_maker / app.py
weepakistan's picture
Update app.py
126631f verified
raw
history blame
3.54 kB
import gradio as gr
from gradio_client import Client
client = Client("stabilityai/stable-diffusion-3-medium")
def generate_logo(prompt):
"""Generates a logo using the provided prompt."""
result = client.predict(
prompt=prompt,
negative_prompt="",
seed=0,
randomize_seed=True,
width=1024,
height=1024,
guidance_scale=7,
num_inference_steps=50,
api_name="/infer"
)
return result[0]
# Define example prompts
examples = [
"Logo for a restaurant named 'Haandi'",
"Modern tech company logo named 'InnoTech'",
"Vintage coffee shop logo for 'Brewed Bliss'",
"Luxury hotel logo named 'Regal Stay'",
"Minimalist yoga studio logo called 'Zen Space'",
"Colorful bakery logo for 'Sweet Treats'",
"Elegant fashion brand logo for 'Chic Couture'",
"Rustic farm-to-table restaurant logo 'Harvest Moon'",
"Bold sports team logo for 'Thunderbolts'",
"Playful children's toy store logo 'Toy Land'",
]
# HTML code for the ad banner
ad_code = """
<div style="text-align: center;">
<iframe src="https://www.fiverr.com/gig_widgets?id=U2FsdGVkX1+9vQaosK0mq7xGXzIb/5hdFYIQsmHlpeMwFm5gingveDZKXBz2oJwV7ZwvToxseOx/KzKtr77ryB3qTb83/+GvCyI8OKpZcSgM0sDHzEPlZnqNeu8Db4y/IXlAceA1UcYT5Z3cW5vBLrgJ/WOpyMWSiyfwwMmGngjltQBexcivW7ukRd+/0yos7GCbfGjGdnLPHm2LB/CB9w2mA1i8cVv9LU+UUdj/O5KLRXtnychl9wAMkPTpmwMiyuAfUZy0nbK/Xa5O2UecmCvn7wicTr0TCTpLmIxaEh3YftXOVr9e36OGVYTmy5nlsgujkqJPI7wL0dXfon0ru4kvoycC7UD6m/whMoxrWZOf386qV2eEeXzk3vKO/emXUUfSavtofzSBtjLcyAOVhnHJg27PvVPgvFTQdy0o3F1M0DaHYTVW3Ln45MPYvMSH&affiliate_id=36184&strip_google_tagmanager=true" loading="lazy" data-with-title="false" class="fiverr_nga_frame" frameborder="0" height="350" width="100%" referrerpolicy="no-referrer-when-downgrade" data-mode="random_gigs" onload=" var frame = this; var script = document.createElement('script'); script.addEventListener('load', function() { window.FW_SDK.register(frame); }); script.setAttribute('src', 'https://www.fiverr.com/gig_widgets/sdk'); document.body.appendChild(script); " ></iframe>
</div>
"""
# HTML code for the ad banner
ad_code2 = """
<div style="text-align: center;">
<a href="https://beta.publishers.adsterra.com/referral/UNXJYTziBP" target="_blank" style="display: inline-block;">
<img decoding="async" alt="banner" src="https://landings-cdn.adsterratech.com/referralBanners/gif/468x120_adsterra_reff.gif">
</a>
<a href="https://go.fiverr.com/visit/?bta=36184&brand=fiverrcpa&landingPage=https%253A%252F%252Fwww.fiverr.com%252Fcategories%252Fprogramming-tech%252Fai-coding%252Fai-applications%253Fsource%253Dcategory_tree" target="_blank" style="display: inline-block;">
<img fetchpriority="high" decoding="async" width="468" height="120" src="https://ziverr.xyz/wp-content/uploads/2024/06/PASSIVE-1.gif" class="attachment-large size-large wp-image-1266" alt="">
</a>
</div>
"""
# Define the Gradio interface
iface = gr.Blocks()
with iface:
gr.Markdown("""
# AI Logo Maker
Generate free AI images with your face or any face.<br>
[Click here to Donate](https://nowpayments.io/donation/aheed)<br>
Contact me for bulk processing and more AI software at +92-332-4399819<br>
<b>Duplicate this space if you get error.</b>
""")
gr.HTML(ad_code)
gr.Interface(
fn=generate_logo,
inputs=[
gr.Textbox(label="Describe your logo idea"),
],
outputs=gr.Image(label="Generated Logo"),
examples=examples
)
gr.HTML(ad_code2)
iface.launch()