Spaces:
Sleeping
Sleeping
francescoKrnl
commited on
Commit
β’
1ffaa25
1
Parent(s):
620bfca
Update app.py
Browse files
app.py
CHANGED
@@ -20,7 +20,10 @@ model = Pix2Pix_Turbo("sketch_to_image_stochastic")
|
|
20 |
ITEMS_NAMES = [ "π‘ Lamp","π Bag","ποΈ Sofa","πͺ Chair","ποΈ Car","ποΈ Motorbike"]
|
21 |
MAX_SEED = np.iinfo(np.int32).max
|
22 |
DEFAULT_ITEM_NAME = "π‘ Lamp"
|
23 |
-
|
|
|
|
|
|
|
24 |
return { 'background': Image.new("L", (512, 512), 255),
|
25 |
'layers': [Image.new("L", (512, 512), 255),Image.new("L", (512, 512), 255)],
|
26 |
'composite': Image.new("L", (512, 512), 255)}
|
@@ -42,7 +45,7 @@ def run(image, item_name):
|
|
42 |
ones = empty_image
|
43 |
return ones
|
44 |
print(item_name.split()[1])
|
45 |
-
prompt = item_name.split()[1] + " professional 3d model. octane render, highly detailed, volumetric, dramatic lighting"
|
46 |
inverted_image = ImageOps.invert(image["composite"])
|
47 |
converted_image = inverted_image.convert("RGB")
|
48 |
image_t = TF.to_tensor(converted_image) > 0.5
|
|
|
20 |
ITEMS_NAMES = [ "π‘ Lamp","π Bag","ποΈ Sofa","πͺ Chair","ποΈ Car","ποΈ Motorbike"]
|
21 |
MAX_SEED = np.iinfo(np.int32).max
|
22 |
DEFAULT_ITEM_NAME = "π‘ Lamp"
|
23 |
+
COLORS = ["blue", "red", "black", "yellow", "green", "pink", "grey"]
|
24 |
+
SELECTED_COLOR = random.choice(COLORS)
|
25 |
+
def empty_input_image():
|
26 |
+
SELECTED_COLOR = random.choice(COLORS)
|
27 |
return { 'background': Image.new("L", (512, 512), 255),
|
28 |
'layers': [Image.new("L", (512, 512), 255),Image.new("L", (512, 512), 255)],
|
29 |
'composite': Image.new("L", (512, 512), 255)}
|
|
|
45 |
ones = empty_image
|
46 |
return ones
|
47 |
print(item_name.split()[1])
|
48 |
+
prompt = SELECTED_COLOR + " " + item_name.split()[1] + " professional 3d model. octane render, highly detailed, volumetric, dramatic lighting"
|
49 |
inverted_image = ImageOps.invert(image["composite"])
|
50 |
converted_image = inverted_image.convert("RGB")
|
51 |
image_t = TF.to_tensor(converted_image) > 0.5
|