silveroxides commited on
Commit
569323f
·
verified ·
1 Parent(s): 487bef0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -24
app.py CHANGED
@@ -10,12 +10,12 @@ from huggingface_hub import hf_hub_download
10
  import spaces
11
  from comfy import model_management
12
 
13
- CHROMA_VERSION = "staging_cfg_3/safetensors/2025-06-29_00-49-53.safetensors"
14
 
15
  # Download required models
16
  t5_path = hf_hub_download(repo_id="silveroxides/flan-t5-xxl-encoder-only", filename="flan-t5-xxl_float8_e4m3fn_scaled_stochastic.safetensors", local_dir="models/text_encoders/")
17
  vae_path = hf_hub_download(repo_id="lodestones/Chroma", filename="ae.safetensors", local_dir="models/vae")
18
- unet_path = hf_hub_download(repo_id="silveroxides/chroma-debug-development-only-GGUF", filename=CHROMA_VERSION, local_dir="models/unet")
19
 
20
  # Example prompts with their parameters
21
  EXAMPLES = [
@@ -138,7 +138,7 @@ from nodes import (
138
  VAELoader,
139
  SaveImage,
140
  )
141
-
142
  # Initialize all model loaders outside the function
143
  randomnoise = NODE_CLASS_MAPPINGS["RandomNoise"]()
144
  emptysd3latentimage = NODE_CLASS_MAPPINGS["EmptySD3LatentImage"]()
@@ -146,10 +146,10 @@ ksamplerselect = NODE_CLASS_MAPPINGS["KSamplerSelect"]()
146
  cliploader = CLIPLoader()
147
  t5tokenizeroptions = NODE_CLASS_MAPPINGS["T5TokenizerOptions"]()
148
  cliptextencode = CLIPTextEncode()
149
- unetloader = UNETLoader()
150
  vaeloader = VAELoader()
151
- modelsamplingflux = NODE_CLASS_MAPPINGS["ModelSamplingFlux"]()
152
- cfgguider = NODE_CLASS_MAPPINGS["CFGGuider"]()
153
  betascheduler = NODE_CLASS_MAPPINGS["BetaSamplingScheduler"]()
154
  samplercustomadvanced = NODE_CLASS_MAPPINGS["SamplerCustomAdvanced"]()
155
  vaedecode = VAEDecode()
@@ -160,10 +160,10 @@ cliploader_78 = cliploader.load_clip(
160
  clip_name="flan-t5-xxl_float8_e4m3fn_scaled_stochastic.safetensors", type="chroma", device="default"
161
  )
162
  t5tokenizeroptions_82 = t5tokenizeroptions.set_options(
163
- min_padding=1, min_length=0, clip=get_value_at_index(cliploader_78, 0)
164
  )
165
  unetloader_76 = unetloader.load_unet(
166
- unet_name=CHROMA_VERSION, weight_dtype="default"
167
  )
168
  vaeloader_80 = vaeloader.load_vae(vae_name="ae.safetensors")
169
 
@@ -192,43 +192,34 @@ def generate_image(prompt, negative_prompt, width, height, steps, cfg, seed):
192
  emptysd3latentimage_69 = emptysd3latentimage.generate(
193
  width=width, height=height, batch_size=1
194
  )
195
- ksamplerselect_72 = ksamplerselect.get_sampler(sampler_name="res_multistep")
196
 
197
  cliptextencode_74 = cliptextencode.encode(
198
  text=prompt,
199
  clip=get_value_at_index(t5tokenizeroptions_82, 0),
200
  )
201
 
202
- cliptextencode_75 = cliptextencode.encode(
203
- text=negative_prompt,
204
- clip=get_value_at_index(t5tokenizeroptions_82, 0),
205
- )
206
 
207
- modelsamplingflux_85 = modelsamplingflux.patch(
208
- max_shift=1.0,
209
- base_shift=0.0,
210
- width=width,
211
- height=height,
212
  model=get_value_at_index(unetloader_76, 0),
213
  )
214
 
215
- cfgguider_73 = cfgguider.get_guider(
216
- cfg=cfg,
217
  model=get_value_at_index(unetloader_76, 0),
218
  positive=get_value_at_index(cliptextencode_74, 0),
219
- negative=get_value_at_index(cliptextencode_75, 0),
220
  )
221
 
222
  betascheduler_84 = betascheduler.get_sigmas(
223
  steps=steps,
224
- alpha=0.55,
225
- beta=0.4,
226
  model=get_value_at_index(unetloader_76, 0),
227
  )
228
 
229
  samplercustomadvanced_67 = samplercustomadvanced.sample(
230
  noise=get_value_at_index(randomnoise_68, 0),
231
- guider=get_value_at_index(cfgguider_73, 0),
232
  sampler=get_value_at_index(ksamplerselect_72, 0),
233
  sigmas=get_value_at_index(betascheduler_84, 0),
234
  latent_image=get_value_at_index(emptysd3latentimage_69, 0),
 
10
  import spaces
11
  from comfy import model_management
12
 
13
+ CHROMA_VERSION = "Chroma1-HD-flash-heun/Chroma1-HD-flash-heun-fp8_scaled_original_hybrid_large.safetensors"
14
 
15
  # Download required models
16
  t5_path = hf_hub_download(repo_id="silveroxides/flan-t5-xxl-encoder-only", filename="flan-t5-xxl_float8_e4m3fn_scaled_stochastic.safetensors", local_dir="models/text_encoders/")
17
  vae_path = hf_hub_download(repo_id="lodestones/Chroma", filename="ae.safetensors", local_dir="models/vae")
18
+ unet_path = hf_hub_download(repo_id="silveroxides/Chroma-Misc-Models", filename=CHROMA_VERSION, local_dir="models/unet")
19
 
20
  # Example prompts with their parameters
21
  EXAMPLES = [
 
138
  VAELoader,
139
  SaveImage,
140
  )
141
+ from custom_nodes.
142
  # Initialize all model loaders outside the function
143
  randomnoise = NODE_CLASS_MAPPINGS["RandomNoise"]()
144
  emptysd3latentimage = NODE_CLASS_MAPPINGS["EmptySD3LatentImage"]()
 
146
  cliploader = CLIPLoader()
147
  t5tokenizeroptions = NODE_CLASS_MAPPINGS["T5TokenizerOptions"]()
148
  cliptextencode = CLIPTextEncode()
149
+ unetloader = NODE_CLASS_MAPPINGS["ScaledFP8HybridUNetLoader"]()
150
  vaeloader = VAELoader()
151
+ modelsamplingauraflow = NODE_CLASS_MAPPINGS["ModelSamplingAuraflow"]()
152
+ basicguider = NODE_CLASS_MAPPINGS["BasicGuider"]()
153
  betascheduler = NODE_CLASS_MAPPINGS["BetaSamplingScheduler"]()
154
  samplercustomadvanced = NODE_CLASS_MAPPINGS["SamplerCustomAdvanced"]()
155
  vaedecode = VAEDecode()
 
160
  clip_name="flan-t5-xxl_float8_e4m3fn_scaled_stochastic.safetensors", type="chroma", device="default"
161
  )
162
  t5tokenizeroptions_82 = t5tokenizeroptions.set_options(
163
+ min_padding=0, min_length=0, clip=get_value_at_index(cliploader_78, 0)
164
  )
165
  unetloader_76 = unetloader.load_unet(
166
+ model_name=CHROMA_VERSION, chroma_hybrid_large=True, radiance_hybrid_large=False, chroma_hybrid_small=False, radiance_hybrid_small=False, wan=False, qwen=False
167
  )
168
  vaeloader_80 = vaeloader.load_vae(vae_name="ae.safetensors")
169
 
 
192
  emptysd3latentimage_69 = emptysd3latentimage.generate(
193
  width=width, height=height, batch_size=1
194
  )
195
+ ksamplerselect_72 = ksamplerselect.get_sampler(sampler_name="dpmpp_sde")
196
 
197
  cliptextencode_74 = cliptextencode.encode(
198
  text=prompt,
199
  clip=get_value_at_index(t5tokenizeroptions_82, 0),
200
  )
201
 
 
 
 
 
202
 
203
+ modelsamplingauraflow_85 = modelsamplingauraflow.patch(
204
+ shift=1.0,
 
 
 
205
  model=get_value_at_index(unetloader_76, 0),
206
  )
207
 
208
+ basicguider_73 = basicguider.get_guider(
 
209
  model=get_value_at_index(unetloader_76, 0),
210
  positive=get_value_at_index(cliptextencode_74, 0),
 
211
  )
212
 
213
  betascheduler_84 = betascheduler.get_sigmas(
214
  steps=steps,
215
+ alpha=0.45,
216
+ beta=0.45,
217
  model=get_value_at_index(unetloader_76, 0),
218
  )
219
 
220
  samplercustomadvanced_67 = samplercustomadvanced.sample(
221
  noise=get_value_at_index(randomnoise_68, 0),
222
+ guider=get_value_at_index(basicguider_73, 0),
223
  sampler=get_value_at_index(ksamplerselect_72, 0),
224
  sigmas=get_value_at_index(betascheduler_84, 0),
225
  latent_image=get_value_at_index(emptysd3latentimage_69, 0),