@@ -98,42 +98,14 @@ def run(self, p, poUseColor,poFormat, poOpaque, poTight, poKeepPnm, poThreshold,
98
98
# Add the prompt from above
99
99
p .prompt += StyleDict [poUseColor ]
100
100
101
- # not yet
102
- # p.cfg_scale=BASE_SCALE
103
- # p.steps = BASE_STEPS
104
-
105
- images = []
106
101
proc = process_images (p )
107
- images += proc .images
108
-
109
- # unfortunately the concrete file name is nontrivial using increment counter etc, so we have to reverse-guess the last stored images by changetime
110
- folder = p .outpath_samples
111
-
112
- if opts .save_to_dirs :
113
- folder = glob .glob (p .outpath_samples + "/*" )
114
- folder = max (folder , key = os .path .getctime )
115
-
116
- tobeglobbed = folder + "/*." + opts .samples_format
117
- files = glob .glob (tobeglobbed )
118
-
119
- if (len (files ) < 1 ) :
120
- print ("Txt2Vector: image file not yet written, waiting two seconds for filesystem..." )
121
- print ("files before wait: " + '\n ' .join (map (str , files )))
122
- time .sleep (2 )
123
- files = glob .glob (tobeglobbed )
124
- print ("files after wait: " + '\n ' .join (map (str , files )))
125
-
126
- assert len (files ) > 0 , "no image file found in folder:" + tobeglobbed
127
-
128
- # latest first
129
- files = sorted (files , key = os .path .getctime , reverse = True )
130
-
131
102
mixedImages = []
103
+
132
104
try :
133
105
# vectorize
134
- for i ,img in enumerate (images [::- 1 ]):
106
+ for i ,img in enumerate (proc . images [::- 1 ]):
135
107
if (not hasattr (img ,"already_saved_as" )) : continue
136
- fullfn = files [ i ]
108
+ fullfn = img . already_saved_as
137
109
fullfnPath = pathlib .Path (fullfn )
138
110
139
111
fullofpnm = fullfnPath .with_suffix ('.pnm' ) #for vectorizing
0 commit comments