Skip to content
This repository was archived by the owner on Nov 4, 2023. It is now read-only.

Commit d97d2f4

Browse files
committed
Initial commit
0 parents  commit d97d2f4

File tree

13,373 files changed

+165966
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

13,373 files changed

+165966
-0
lines changed

.breakpoints

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"files": {}
3+
}

.replit

+105
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
# The command that runs the program. If the interpreter field is set, it will have priority and this run command will do nothing
2+
run = "python3 main.py"
3+
4+
# The primary language of the repl. There can be others, though!
5+
language = "python3"
6+
entrypoint = "main.py"
7+
# A list of globs that specify which files and directories should
8+
# be hidden in the workspace.
9+
hidden = ["venv", ".config", "**/__pycache__", "**/.mypy_cache", "**/*.pyc"]
10+
11+
# Specifies which nix channel to use when building the environment.
12+
[nix]
13+
channel = "stable-21_11"
14+
15+
# The command to start the interpreter.
16+
[interpreter]
17+
[interpreter.command]
18+
args = [
19+
"stderred",
20+
"--",
21+
"prybar-python3",
22+
"-q",
23+
"--ps1",
24+
"\u0001\u001b[33m\u0002\u0001\u001b[00m\u0002 ",
25+
"-i",
26+
]
27+
env = { LD_LIBRARY_PATH = "$PYTHON_LD_LIBRARY_PATH" }
28+
29+
[env]
30+
VIRTUAL_ENV = "/home/runner/${REPL_SLUG}/venv"
31+
PATH = "${VIRTUAL_ENV}/bin"
32+
PYTHONPATH = "${VIRTUAL_ENV}/lib/python3.8/site-packages"
33+
REPLIT_POETRY_PYPI_REPOSITORY = "https://package-proxy.replit.com/pypi/"
34+
MPLBACKEND = "TkAgg"
35+
POETRY_CACHE_DIR = "${HOME}/${REPL_SLUG}/.cache/pypoetry"
36+
37+
# Enable unit tests. This is only supported for a few languages.
38+
[unitTest]
39+
language = "python3"
40+
41+
# Add a debugger!
42+
[debugger]
43+
support = true
44+
45+
# How to start the debugger.
46+
[debugger.interactive]
47+
transport = "localhost:0"
48+
startCommand = ["dap-python", "main.py"]
49+
50+
# How to communicate with the debugger.
51+
[debugger.interactive.integratedAdapter]
52+
dapTcpAddress = "localhost:0"
53+
54+
# How to tell the debugger to start a debugging session.
55+
[debugger.interactive.initializeMessage]
56+
command = "initialize"
57+
type = "request"
58+
59+
[debugger.interactive.initializeMessage.arguments]
60+
adapterID = "debugpy"
61+
clientID = "replit"
62+
clientName = "replit.com"
63+
columnsStartAt1 = true
64+
linesStartAt1 = true
65+
locale = "en-us"
66+
pathFormat = "path"
67+
supportsInvalidatedEvent = true
68+
supportsProgressReporting = true
69+
supportsRunInTerminalRequest = true
70+
supportsVariablePaging = true
71+
supportsVariableType = true
72+
73+
# How to tell the debugger to start the debuggee application.
74+
[debugger.interactive.launchMessage]
75+
command = "attach"
76+
type = "request"
77+
78+
[debugger.interactive.launchMessage.arguments]
79+
logging = {}
80+
81+
# Configures the packager.
82+
[packager]
83+
language = "python3"
84+
ignoredPackages = ["unit_tests"]
85+
86+
[packager.features]
87+
enabledForHosting = false
88+
# Enable searching packages from the sidebar.
89+
packageSearch = true
90+
# Enable guessing what packages are needed from the code.
91+
guessImports = true
92+
93+
# These are the files that need to be preserved when this
94+
# language template is used as the base language template
95+
# for Python repos imported from GitHub
96+
[gitHubImport]
97+
requiredFiles = [".replit", "replit.nix", ".config", "venv"]
98+
99+
[languages]
100+
101+
[languages.python3]
102+
pattern = "**/*.py"
103+
104+
[languages.python3.languageServer]
105+
start = "pylsp"

README.md

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Hello, this is the Logo generator.
2+
3+
Once you give a prompt, 2 different AI's will generate 4 different logo's and they will be automatically uploaded to a CDN.
4+
5+
To start, go to secrets and add your openAI API key.
6+
![Secrets](https://cdn.rdsl.me/broGgm.png)
7+
8+
Or if it isn't hosted on Replit, add it in the .env file
9+
10+
# Config.json
11+
`favicon`: A direct url to a image. This is used as favicon \
12+
`title`: The name that is used as website title. For example the index is `<title> - Home`. \
13+
`lockdown`: If you enable lockdown and restart the repl the webserver will only display a lockdown message. This feature was added to make sure no one spams logo's while I am not online.

__pycache__/utils.cpython-38.pyc

3.37 KB
Binary file not shown.

assets/random.json

+104
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
{
2+
"prompts": [
3+
"A tech startup that specializes in developing mobile apps",
4+
"Create a logo for a luxury fashion brand that sells high-end clothing and accessories",
5+
"Design a logo for a health food store that sells organic and locally sourced products",
6+
"Create a logo for a bakery that specializes in artisan breads and pastries",
7+
"A yoga studio that offers a variety of classes and workshops",
8+
"Design a logo for a restaurant that serves modern American cuisine with a focus on local and sustainable ingredients",
9+
"Create a logo for a personal training and fitness coaching business",
10+
"A wedding planning and event design company",
11+
"Design a logo for a creative agency that provides marketing and branding services",
12+
"Create a logo for a home renovation and interior design firm",
13+
"A craft brewery that produces a variety of unique and innovative beers",
14+
"Design a logo for a online store that sells handmade and vintage goods",
15+
"Create a logo for a furniture store that specializes in mid-century modern design",
16+
"A cycling studio that offers a variety of indoor cycling classes",
17+
"Design a logo for a coffee shop that sources its beans from small, independent farms",
18+
"Create a logo for a children's clothing boutique that sells high-quality, stylish clothing",
19+
"A florist that offers a wide range of fresh flowers and plants",
20+
"Design a logo for a beauty salon that provides a range of services including haircuts, styling, and makeup",
21+
"Create a logo for a pet store that sells a variety of high-quality pet food and supplies",
22+
"A travel agency that helps clients plan and book their dream vacations",
23+
"Design a logo for a software company that develops innovative solutions for businesses",
24+
"Create a logo for a consulting firm that helps companies improve their operations and increase efficiency",
25+
"A dental practice that offers a range of services including cleanings, fillings, and cosmetic procedures",
26+
"Design a logo for a graphic design studio that specializes in branding and identity design",
27+
"Create a logo for a physical therapy and rehabilitation center",
28+
"A music school that offers private lessons and group classes for a variety of instruments",
29+
"Design a logo for a car dealership that sells a wide range of new and used vehicles",
30+
"Create a logo for a plant nursery that sells a variety of annuals, perennials, and shrubs",
31+
"A chiropractic clinic that focuses on natural, holistic healing techniques",
32+
"Design a logo for a language school that offers a range of language courses and cultural workshops",
33+
"Create a logo for a farmers market that sells fresh, locally grown produce and artisanal goods",
34+
"A real estate agency that helps clients buy and sell properties",
35+
"Design a logo for a automotive repair shop that provides a range of services including oil changes, tire rotations, and engine repairs",
36+
"Create a logo for a day spa that offers a variety of relaxation and rejuvenation treatments",
37+
"A hair salon that specializes in styling, coloring, and cutting services",
38+
"Design a logo for a pet grooming business that offers a range of services including baths, haircuts, and nail trims",
39+
"A luxury car dealership that sells high-end, exotic vehicles",
40+
"Create a logo for a home security company that provides a range of home protection services",
41+
"Design a logo for a cleaning and housekeeping business that offers a variety of services including laundry, dusting, and organization",
42+
"Create a logo for a graphic design studio that specializes in creating logos and branding materials",
43+
"A furniture store that sells a variety of stylish and contemporary home furnishings",
44+
"Design a logo for a online store that sells a wide range of sporting goods and outdoor equipment",
45+
"Create a logo for a coffee shop that offers a variety of specialty drinks and snacks",
46+
"A pet grooming business that offers a range of services including baths, haircuts, and nail trims",
47+
"Design a logo for a landscaping company that offers a variety of services including lawn care, garden design, and tree care",
48+
"Create a logo for a home improvement store that sells a variety of tools, hardware, and home decor items",
49+
"A logo for a automotive repair shop that provides a range of services including oil changes, tire rotations, and engine repairs",
50+
"Design a logo for a computer repair and IT support company that helps businesses and individuals with their technology needs",
51+
"Create a logo for a coffee roastery that sources its beans from small, independent farms and produces a variety of unique and innovative roasts",
52+
"A logo for a home security company that provides a range of home protection services",
53+
"Design a logo for a event planning and catering business that specializes in creating custom, memorable events",
54+
"Create a logo for a accounting and tax preparation firm that helps businesses and individuals with their financial needs",
55+
"A legal services firm that offers a range of services including contract review, dispute resolution, and litigation",
56+
"Design a logo for a home cleaning and maid service company that offers a variety of services including dusting, laundry, and organization",
57+
"Create a logo for a artisanal chocolate shop that produces a variety of handcrafted chocolates and confections",
58+
"A beauty salon that provides a range of services including haircuts, styling, and makeup",
59+
"Design a logo for a online store that sells a variety of high-quality, artisanal food products",
60+
"Create a logo for a clothing store that sells a variety of stylish and fashionable clothing and accessories",
61+
"A music school that offers a range of private lessons and group classes for a variety of instruments",
62+
"Design a logo for a travel agency that helps clients plan and book their dream vacations",
63+
"Create a logo for a personal training and fitness coaching business",
64+
"A restaurant that specializes in vegetarian and vegan cuisine",
65+
"A online store that sells a variety of handmade and vintage goods",
66+
"Create a logo for a yoga studio that offers a variety of classes and workshops",
67+
"A home decor and furniture store that sells a variety of stylish and contemporary home furnishings",
68+
"Design a logo for a car dealership that sells a wide range of new and used vehicles",
69+
"Create a logo for a plant nursery that sells a variety of annuals, perennials, and shrubs",
70+
"Generate a logo for a online marketplace that connects buyers and sellers of handmade and vintage goods",
71+
"Create a logo for a craft brewery that produces a variety of unique and innovative beers",
72+
"Design a logo for a gourmet food store that sells a wide range of high-quality, artisanal food products",
73+
"Create a logo for a wedding planning and event design company",
74+
"Generate a logo for a beauty salon that provides a range of services including haircuts, styling, and makeup",
75+
"Design a logo for a online store that sells a wide range of sporting goods and outdoor equipment",
76+
"Create a logo for a furniture store that specializes in mid-century modern design",
77+
"Generate a logo for a personal training and fitness coaching business",
78+
"Design a logo for a home renovation and interior design firm",
79+
"Create a logo for a consulting firm that helps companies improve their operations and increase efficiency",
80+
"Generate a logo for a dental practice that offers a range of services including cleanings, fillings, and cosmetic procedures",
81+
"Design a logo for a software company that develops innovative solutions for businesses",
82+
"Create a logo for a graphic design studio that specialized in branding and identity design",
83+
"Generate a logo for a travel agency that helps clients plan and book their dream vacations",
84+
"Design a logo for a chiropractic clinic that focuses on natural, holistic healing techniques",
85+
"Create a logo for a plant nursery that sells a variety of annuals, perennials, and shrubs",
86+
"Generate a logo for a music school that offers private lessons and group classes for a variety of instruments",
87+
"Design a logo for a car dealership that sells a wide range of new and used vehicles",
88+
"Create a logo for a language school that offers a range of language courses and cultural workshops",
89+
"Generate a logo for a farmers market that sells fresh, locally grown produce and artisanal goods",
90+
"Design a logo for a real estate agency that helps clients buy and sell properties",
91+
"Create a logo for a automotive repair shop that provides a range of services including oil changes, tire rotations, and engine repairs",
92+
"Generate a logo for a day spa that offers a variety of relaxation and rejuvenation treatments",
93+
"Design a logo for a pet grooming business that offers a range of services including baths, haircuts, and nail trims",
94+
"Create a logo for a hair salon that specialized in styling, coloring, and cutting services",
95+
"Generate a logo for a home cleaning and maid service company that offers a variety of services including dusting, laundry, and organization",
96+
"Design a logo for a legal services firm that offers a range of services including contract review, dispute resolution, and litigation",
97+
"Create a logo for a accounting and tax preparation firm that helps businesses and individuals with their financial needs",
98+
"Generate a logo for a event planning and catering business that specialized in creating custom, memorable events",
99+
"Design a logo for a coffee roastery that sources its beans from small, independent farms and produces a variety of unique and innovative roasts",
100+
"Create a logo for a computer repair and IT support company that helps businesses and individuals with their technology needs",
101+
"Generate a logo for a home security company that provides a range of home protection services",
102+
"Design a logo for a cleaning and housekeeping business that offers a variety of services including laundry, dusting"
103+
]
104+
}

config.json

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"favicon": "https://cdn.discordapp.com/attachments/963507913660440726/1057981265757868052/output.png",
3+
"title": "Logo Generator",
4+
"lockdown": false
5+
}

images/logo1.png

192 KB
Loading

images/logo2.png

192 KB
Loading

images/logo3.jpg

192 KB
Loading

images/logo4.jpg

192 KB
Loading

main.py

+75
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
import requests, os, glob, json, base64, time
2+
import openai
3+
from utils import delete, upload_file, gpt, dalle1, dalle2, convertFromSeconds # API AI
4+
openai.api_key = os.getenv("API_KEY")
5+
6+
REPLURL = f"{os.environ['REPL_SLUG']}.{os.environ['REPL_OWNER']}.repl.co" # used to get the images from an URL.
7+
8+
# FLASK
9+
try:
10+
with open("config.json") as f: # config
11+
data = json.load(f)
12+
print("\033[32m[config] Loaded\033[0m")
13+
except: print("\033[1[config] Unable to load\033[0")
14+
15+
from flask import Flask, render_template, request, send_from_directory # webserver imports
16+
from waitress import serve
17+
18+
app = Flask(__name__)
19+
20+
@app.route('/')
21+
def index():
22+
"""Renders the index page"""
23+
if data['lockdown']: return render_template("msg.html", shortmsg="Lockdown mode",msg="The server is currently in lockdown. Please come back later!", buttons=False, favi=data["favicon"], title=data["title"])
24+
25+
return render_template("index.html", favi=data["favicon"], title=data["title"])
26+
27+
@app.route('/editor')
28+
def editor():
29+
"""Renders the editor page"""
30+
if data['lockdown']: return render_template("msg.html", shortmsg="Lockdown mode",msg="The server is currently in lockdown. Please come back later!", buttons=False, favi=data["favicon"], title=data["title"])
31+
32+
return render_template("editor.html", favi=data["favicon"], title=data["title"])
33+
@app.route('/generate')
34+
def generate():
35+
"""Generates images and renders them"""
36+
if data['lockdown']: return render_template("msg.html", shortmsg="Lockdown mode",msg="The server is currently in lockdown. Please come back later!", buttons=False, favi=data["favicon"], title=data["title"], mark=data["downloadMark"])
37+
else:
38+
39+
start = time.time()
40+
prompt = request.args.get('desc')
41+
if prompt is not None: #check if a prompt was given
42+
icon = gpt(prompt)
43+
#delete()
44+
list1 = dalle1(2, icon)
45+
list2 = dalle2(2, icon)
46+
for i in list1:
47+
list2.append(i)
48+
logo1, logo2, logo3, logo4 = list2
49+
50+
return render_template("generate.html", favi=data["favicon"], title=data["title"], url=REPLURL, logo1=logo1, logo2=logo2, logo3=logo3, logo4=logo4, time=round(time.time()-start))
51+
else: return render_template("msg.html", shortmsg="No prompt",msg="No prompt was given. Please provide a prompt so I can generate logo's!", buttons=True, favi=data["favicon"], title=data["title"])
52+
53+
@app.route('/images/<path:path>')
54+
def send_image(path):
55+
if data['lockdown']: return render_template("msg.html", shortmsg="Lockdown mode",msg="The server is currently in lockdown. Please come back later!", buttons=False, favi=data["favicon"], title=data["title"])
56+
57+
return send_from_directory('images', path)
58+
59+
@app.route('/assets/<path:path>')
60+
def send_asset(path):
61+
if data['lockdown']: return render_template("msg.html", shortmsg="Lockdown mode",msg="The server is currently in lockdown. Please come back later!", buttons=False, favi=data["favicon"], title=data["title"])
62+
63+
return send_from_directory('assets', path)
64+
65+
@app.errorhandler(404)
66+
def page_not_found(e):
67+
if data['lockdown']: return render_template("msg.html", shortmsg="Lockdown mode",msg="The server is currently in lockdown. Please come back later!", buttons=False, favi=data["favicon"], title=data["title"])
68+
return render_template("msg.html", shortmsg="404",msg="It looks like the page you were looking for is not here D:", buttons=True, favi=data["favicon"], title=data["title"])
69+
70+
if __name__ == "__main__":
71+
#app.run('0.0.0.0',port=server_port)
72+
started=round(time.time())
73+
print(f"\033[32m[Waitress] serving on \033[0;36m\"{REPLURL}\"\033[0m at {convertFromSeconds(started)}")
74+
75+
serve(app, port=8080)

0 commit comments

Comments
 (0)