Skip to content

Conversation

@Tenos-ai
Copy link
Owner

@Tenos-ai Tenos-ai commented Nov 9, 2025

Summary

  • remove the redundant Qwen KSampler CFG controls from the editor templates and UI to avoid confusing duplicates
  • drive Qwen sampler CFG directly from the default guidance setting while migrating any legacy values during settings load
  • keep workflow generation aligned with the simplified guidance configuration

Testing

  • pytest tests/test_workflow_templates.py

Codex Task

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @Tenos-ai, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request refines the configuration experience for Qwen models by eliminating duplicate KSampler CFG settings. The change ensures that Qwen's sampler CFG is consistently managed through the primary default guidance setting, reducing complexity and potential user error. It also includes a robust migration path for existing configurations and updates default values to a more appropriate baseline.

Highlights

  • Configuration Simplification: Removed redundant Qwen KSampler CFG controls from editor templates and the user interface to streamline configuration and prevent confusion.
  • Unified Guidance Control: The Qwen sampler CFG is now directly driven by the default guidance setting, consolidating control into a single, consistent parameter.
  • Legacy Value Migration: Implemented logic to automatically migrate any existing legacy Qwen KSampler CFG values to the new default guidance setting when application settings are loaded.
  • Default Value Update: Updated the default guidance values for Qwen and Qwen Edit across various settings and workflow templates from 5.5 to 2.5, aligning with the simplified configuration.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request simplifies the configuration for the Qwen model by removing redundant CFG controls and driving the sampler CFG from the default guidance settings. The changes include migrating legacy settings, updating default values, and removing the obsolete configuration from the UI and templates. The implementation looks solid, especially the migration logic in settings_manager.py which correctly handles legacy values while preserving user customizations. I've added a couple of suggestions to improve code conciseness and maintainability in areas where settings are parsed.

Comment on lines +1025 to +1029
final_guidance = settings.get('default_guidance_qwen_edit', 2.5)
try:
final_guidance = float(final_guidance)
except (ValueError, TypeError):
final_guidance = 5.5
final_guidance = 2.5
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This block for getting and converting the guidance value can be made more concise. The current implementation is a bit verbose and can be simplified to reduce redundancy.

Suggested change
final_guidance = settings.get('default_guidance_qwen_edit', 2.5)
try:
final_guidance = float(final_guidance)
except (ValueError, TypeError):
final_guidance = 5.5
final_guidance = 2.5
try:
final_guidance = float(settings.get('default_guidance_qwen_edit', 2.5))
except (ValueError, TypeError):
final_guidance = 2.5

Comment on lines 1760 to +1763
try:
current_guidance = float(settings.get('default_guidance_qwen_edit', 5.5))
current_guidance = float(settings.get('default_guidance_qwen_edit', 2.5))
except (ValueError, TypeError):
current_guidance = 5.5
current_guidance = 2.5
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

To improve maintainability and avoid magic numbers, it's a good practice to define 2.5 as a constant, especially since it's used twice here. This makes it easier to update the value in the future and improves readability.

Suggested change
try:
current_guidance = float(settings.get('default_guidance_qwen_edit', 5.5))
current_guidance = float(settings.get('default_guidance_qwen_edit', 2.5))
except (ValueError, TypeError):
current_guidance = 5.5
current_guidance = 2.5
DEFAULT_QWEN_EDIT_GUIDANCE = 2.5
try:
current_guidance = float(settings.get('default_guidance_qwen_edit', DEFAULT_QWEN_EDIT_GUIDANCE))
except (ValueError, TypeError):
current_guidance = DEFAULT_QWEN_EDIT_GUIDANCE

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +362 to +376
legacy_cfg_pairs = (
("qwen_ksampler_cfg", "default_guidance_qwen"),
("qwen_edit_ksampler_cfg", "default_guidance_qwen_edit"),
)
for legacy_key, guidance_key in legacy_cfg_pairs:
if legacy_key in settings:
legacy_value = settings.pop(legacy_key)
try:
coerced = float(legacy_value)
except (TypeError, ValueError):
coerced = None
if coerced is not None:
current_guidance = settings.get(guidance_key)
if current_guidance in (None, "") or current_guidance == default_settings.get(guidance_key):
settings[guidance_key] = coerced

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Preserve legacy Qwen CFG overrides during settings migration

The migration only copies qwen_ksampler_cfg/qwen_edit_ksampler_cfg into the new unified guidance keys when the existing guidance value is None, empty, or equal to _get_default_settings()’s value (now 2.5). On existing installs, default_guidance_qwen and default_guidance_qwen_edit will typically still be the previous default 5.5 while users may have customised only the KSampler CFG fields. With the current check, those customised CFG values are popped and discarded, leaving the guidance set to 5.5 after upgrade. Any user who tuned the sampler CFG but not the guidance will silently lose their configuration. Consider treating the old default (5.5) as “unmodified” or always migrating the legacy key’s value so custom sampler guidance survives the upgrade.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants