Spaces:
No application file

File size: 1,120 Bytes
85bdd6c
affe129
 
 
 
 
85bdd6c
 
 
 
 
 
 
 
 
 
affe129
 
 
 
 
 
85bdd6c
affe129
 
85bdd6c
 
 
 
 
 
 
 
 
 
 
 
 
affe129
85bdd6c
 
 
 
 
affe129
 
 
 
 
85bdd6c
 
 
 
 
affe129
 
 
 
85bdd6c
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
```python id="g7r5g0"
import gradio as gr
from PIL import Image, ImageDraw
import random

def generate_image(prompt):

    width = 768
    height = 768

    img = Image.new(
        "RGB",
        (width, height),
        color=(15, 15, 25)
    )

    draw = ImageDraw.Draw(img)

    colors = [
        (255, 0, 140),
        (125, 44, 255),
        (0, 255, 200),
        (255, 120, 0),
    ]

    for i in range(40):

        x1 = random.randint(0, width)
        y1 = random.randint(0, height)

        x2 = random.randint(0, width)
        y2 = random.randint(0, height)

        draw.rectangle(
            [x1, y1, x2, y2],
            outline=random.choice(colors),
            width=3
        )

    draw.text(
        (30, 30),
        prompt,
        fill=(255, 255, 255)
    )

    return img

demo = gr.Interface(
    fn=generate_image,
    inputs=gr.Textbox(
        label="Enter Prompt",
        placeholder="luxury AI influencer photoshoot"
    ),
    outputs=gr.Image(label="Generated Image"),
    title="Squirt4Daddy AI Generator",
    description="AI creator image generator demo"
)

demo.launch()
```